This commit is contained in:
j3d1 2023-12-09 01:07:01 +01:00
parent 916de9fd6b
commit 6aaa522a6b

View file

@ -3,6 +3,7 @@ from rest_framework.decorators import api_view, permission_classes, authenticati
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.authentication import BasicAuthentication from rest_framework.authentication import BasicAuthentication
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.urls import path
class UserSerializer(serializers.ModelSerializer): class UserSerializer(serializers.ModelSerializer):
@ -50,4 +51,7 @@ def registerUser(request):
router = routers.SimpleRouter() router = routers.SimpleRouter()
router.register(r'users', UserViewSet, basename='users') router.register(r'users', UserViewSet, basename='users')
urlpatterns = router.urls urlpatterns = router.urls + [
path('token/', token),
path('register/', registerUser),
]