Using django-rest-framework with AngularJS as front-end framework.

Other topics

DRF View

class UserRegistration(APIView):
    def post(self, request, *args, **kwargs):
        serializer = UserRegistrationSerializer(data=request.data)
        serializer.is_valid(raise_exception=True)
        serializer.save()
        return Response(serializer.to_representation(instance=serializer.instance), status=status.HTTP_201_CREATED)

Angular Request

$http.post("\<domain\>/user-registration/", {username: username, password: password})
     .then(function (data) { 
         // Do success actions here
     });

Contributors

Topic Id: 10893

Example Ids: 32619,32620

This site is not affiliated with any of the contributors.