running server

This commit is contained in:
Peter Kotyczka 2024-04-04 11:27:57 +02:00
parent 88ea419c20
commit cbb9daad6c
10 changed files with 8 additions and 9 deletions

BIN
pyapp/pyapp/__pycache__/wsgi.cpython-311.pyc Executable file → Normal file

Binary file not shown.

View File

@ -1,5 +1,5 @@
from django.contrib import admin
from app.pyapp.models import ShoppingItem
from pyapp.models import ShoppingItem
# Register your models here.
admin.site.register(ShoppingItem)

View File

@ -1,6 +1,5 @@
from django.apps import AppConfig
class PyappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'pyapp'

View File

@ -1,5 +1,5 @@
from rest_framework import serializers
from .models import ShoppingItem
from pyapp.models import ShoppingItem
class ShoppingItemSerializer(serializers.ModelSerializer):
class Meta:

View File

@ -34,7 +34,7 @@
</head>
<body>
<header>
<h1>PyApp Apis</h1>
<h1>PyApp Inventory</h1>
</header>
{% for item in all_items %}
<div class="list-item">

View File

@ -14,11 +14,11 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path
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.urls import path,include
from app.pyapp.views import pyapp_home
from app.pyapp.views import api_home
from pyapp.views import pyapp_home
from pyapp.views import api_home
urlpatterns = [

View File

@ -1,8 +1,8 @@
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from pyapp.pyapp.models import ShoppingItem
from pyapp.models import ShoppingItem
from rest_framework import viewsets
from pyapp.pyapp.serializers import ShoppingItemSerializer
from pyapp.serializers import ShoppingItemSerializer
class ShoppingItemViewSet(viewsets.ModelViewSet):
queryset = ShoppingItem.objects.all()