0% found this document useful (0 votes)
3 views1 page

Django API User Registration View

Uploaded by

chessmore
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Django API User Registration View

Uploaded by

chessmore
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

from rest_framework.

views import APIView


from rest_framework.response import Response
from rest_framework import status
from .serializers import StudentUserSerializer

class RegisterUserView(APIView):
def post(self, request):
serializer = StudentUserSerializer(data=[Link])
if serializer.is_valid():
[Link]()
return Response({"message": "User created successfully."},
status=status.HTTP_201_CREATED)
return Response([Link], status=status.HTTP_400_BAD_REQUEST)

You might also like