feat: add comprehensive GitHub workflow and development tools
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3
app/.venv/Lib/site-packages/tutorial/quickstart/admin.py
Normal file
3
app/.venv/Lib/site-packages/tutorial/quickstart/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
app/.venv/Lib/site-packages/tutorial/quickstart/apps.py
Normal file
6
app/.venv/Lib/site-packages/tutorial/quickstart/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class QuickstartConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'quickstart'
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@@ -0,0 +1,14 @@
|
||||
from django.contrib.auth.models import Group, User
|
||||
from rest_framework import serializers
|
||||
|
||||
|
||||
class UserSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ['url', 'username', 'email', 'groups']
|
||||
|
||||
|
||||
class GroupSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = Group
|
||||
fields = ['url', 'name']
|
||||
3
app/.venv/Lib/site-packages/tutorial/quickstart/tests.py
Normal file
3
app/.venv/Lib/site-packages/tutorial/quickstart/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
31
app/.venv/Lib/site-packages/tutorial/quickstart/views.py
Normal file
31
app/.venv/Lib/site-packages/tutorial/quickstart/views.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from django.contrib.auth.models import Group, User
|
||||
from rest_framework import permissions, viewsets, views, response
|
||||
|
||||
from tutorial.quickstart.serializers import GroupSerializer, UserSerializer
|
||||
|
||||
|
||||
class UserViewSet(viewsets.ModelViewSet):
|
||||
"""
|
||||
API endpoint that allows users to be viewed or edited.
|
||||
"""
|
||||
queryset = User.objects.all().order_by('-date_joined')
|
||||
serializer_class = UserSerializer
|
||||
permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
|
||||
class GroupViewSet(viewsets.ModelViewSet):
|
||||
"""
|
||||
API endpoint that allows groups to be viewed or edited.
|
||||
"""
|
||||
queryset = Group.objects.all().order_by('name')
|
||||
serializer_class = GroupSerializer
|
||||
permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
|
||||
class Index(views.APIView):
|
||||
def get(self, request):
|
||||
bar = request.GET.get('bar', '')
|
||||
r = response.Response(data={'message': 'Hello, world!'})
|
||||
#r.headers['Location'] = '\n\n'
|
||||
r.headers['Location'] = f'http://localhost:8000/api/?bar={bar}'
|
||||
return r
|
||||
Reference in New Issue
Block a user