mirror of
https://git.kotyczka.ch/developers/django.git
synced 2025-04-07 00:03:32 +02:00
running server
This commit is contained in:
parent
88ea419c20
commit
cbb9daad6c
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
pyapp/pyapp/__pycache__/wsgi.cpython-311.pyc
Executable file → Normal file
BIN
pyapp/pyapp/__pycache__/wsgi.cpython-311.pyc
Executable file → Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from app.pyapp.models import ShoppingItem
|
from pyapp.models import ShoppingItem
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
admin.site.register(ShoppingItem)
|
admin.site.register(ShoppingItem)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class PyappConfig(AppConfig):
|
class PyappConfig(AppConfig):
|
||||||
default_auto_field = 'django.db.models.BigAutoField'
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
name = 'pyapp'
|
name = 'pyapp'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from .models import ShoppingItem
|
from pyapp.models import ShoppingItem
|
||||||
|
|
||||||
class ShoppingItemSerializer(serializers.ModelSerializer):
|
class ShoppingItemSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<h1>PyApp Apis</h1>
|
<h1>PyApp Inventory</h1>
|
||||||
</header>
|
</header>
|
||||||
{% for item in all_items %}
|
{% for item in all_items %}
|
||||||
<div class="list-item">
|
<div class="list-item">
|
||||||
|
@ -14,11 +14,11 @@ Including another URLconf
|
|||||||
1. Import the include() function: from django.urls import include, path
|
1. Import the include() function: from django.urls import include, path
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from app.pyapp import views
|
from pyapp import views
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path,include
|
from django.urls import path,include
|
||||||
from app.pyapp.views import pyapp_home
|
from pyapp.views import pyapp_home
|
||||||
from app.pyapp.views import api_home
|
from pyapp.views import api_home
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.http import HttpResponse, JsonResponse
|
from django.http import HttpResponse, JsonResponse
|
||||||
from pyapp.pyapp.models import ShoppingItem
|
from pyapp.models import ShoppingItem
|
||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
from pyapp.pyapp.serializers import ShoppingItemSerializer
|
from pyapp.serializers import ShoppingItemSerializer
|
||||||
|
|
||||||
class ShoppingItemViewSet(viewsets.ModelViewSet):
|
class ShoppingItemViewSet(viewsets.ModelViewSet):
|
||||||
queryset = ShoppingItem.objects.all()
|
queryset = ShoppingItem.objects.all()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user