diff --git a/rest-app/smartpicasso/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/__pycache__/__init__.cpython-38.pyc index 012896b..f266be5 100644 Binary files a/rest-app/smartpicasso/__pycache__/__init__.cpython-38.pyc and b/rest-app/smartpicasso/__pycache__/__init__.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/__pycache__/settings.cpython-38.pyc b/rest-app/smartpicasso/__pycache__/settings.cpython-38.pyc index 092397f..5b58650 100644 Binary files a/rest-app/smartpicasso/__pycache__/settings.cpython-38.pyc and b/rest-app/smartpicasso/__pycache__/settings.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/__pycache__/urls.cpython-38.pyc b/rest-app/smartpicasso/__pycache__/urls.cpython-38.pyc index b91070c..74b3fd5 100644 Binary files a/rest-app/smartpicasso/__pycache__/urls.cpython-38.pyc and b/rest-app/smartpicasso/__pycache__/urls.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/__pycache__/wsgi.cpython-38.pyc b/rest-app/smartpicasso/__pycache__/wsgi.cpython-38.pyc index 4baa4a5..269351c 100644 Binary files a/rest-app/smartpicasso/__pycache__/wsgi.cpython-38.pyc and b/rest-app/smartpicasso/__pycache__/wsgi.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/app/user/__pycache__/__init__.cpython-38.pyc index 8142876..7a008fc 100644 Binary files a/rest-app/smartpicasso/app/user/__pycache__/__init__.cpython-38.pyc and b/rest-app/smartpicasso/app/user/__pycache__/__init__.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user/__pycache__/admin.cpython-38.pyc b/rest-app/smartpicasso/app/user/__pycache__/admin.cpython-38.pyc index 6218ee9..01cd263 100644 Binary files a/rest-app/smartpicasso/app/user/__pycache__/admin.cpython-38.pyc and b/rest-app/smartpicasso/app/user/__pycache__/admin.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user/__pycache__/models.cpython-38.pyc b/rest-app/smartpicasso/app/user/__pycache__/models.cpython-38.pyc index b3aaace..7a0885a 100644 Binary files a/rest-app/smartpicasso/app/user/__pycache__/models.cpython-38.pyc and b/rest-app/smartpicasso/app/user/__pycache__/models.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user/migrations/__pycache__/0001_initial.cpython-38.pyc b/rest-app/smartpicasso/app/user/migrations/__pycache__/0001_initial.cpython-38.pyc index 5119f86..fccce74 100644 Binary files a/rest-app/smartpicasso/app/user/migrations/__pycache__/0001_initial.cpython-38.pyc and b/rest-app/smartpicasso/app/user/migrations/__pycache__/0001_initial.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user/migrations/__pycache__/0002_auto_20201130_2119.cpython-38.pyc b/rest-app/smartpicasso/app/user/migrations/__pycache__/0002_auto_20201130_2119.cpython-38.pyc index 1cde8a2..34c4c8a 100644 Binary files a/rest-app/smartpicasso/app/user/migrations/__pycache__/0002_auto_20201130_2119.cpython-38.pyc and b/rest-app/smartpicasso/app/user/migrations/__pycache__/0002_auto_20201130_2119.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user/migrations/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/app/user/migrations/__pycache__/__init__.cpython-38.pyc index e34e9eb..62d8e5b 100644 Binary files a/rest-app/smartpicasso/app/user/migrations/__pycache__/__init__.cpython-38.pyc and b/rest-app/smartpicasso/app/user/migrations/__pycache__/__init__.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user/views.py b/rest-app/smartpicasso/app/user/views.py index a303436..ecb0a57 100644 --- a/rest-app/smartpicasso/app/user/views.py +++ b/rest-app/smartpicasso/app/user/views.py @@ -1,9 +1,9 @@ from rest_framework import status -from rest_framework.generics import RetrieveAPIView +from rest_framework.generics import RetrieveAPIView, CreateAPIView from rest_framework.permissions import AllowAny from rest_framework.response import Response -from smartpicasso.app.user.serializers import UserLoginSerializer +from smartpicasso.app.user.serializers import UserLoginSerializer, UserRegistrationSerializer class UserLoginView(RetrieveAPIView): @@ -25,3 +25,24 @@ class UserLoginView(RetrieveAPIView): status_code = status.HTTP_200_OK return Response(response, status=status_code) + + +class UserRegistrationView(CreateAPIView): + """ + View for user registration + """ + permission_classes = (AllowAny,) + serializer_class = UserRegistrationSerializer + + def post(self, request): + serializer = self.serializer_class(data=request.data) + serializer.is_valid(raise_exception=True) + serializer.save() + status_code = status.HTTP_201_CREATED + response = { + 'success': 'True', + 'status_code': status_code, + 'message': 'User registered successfully' + } + + return Response(response, status=status_code) diff --git a/rest-app/smartpicasso/app/user_profile/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/__pycache__/__init__.cpython-38.pyc index 90b0343..6b25f62 100644 Binary files a/rest-app/smartpicasso/app/user_profile/__pycache__/__init__.cpython-38.pyc and b/rest-app/smartpicasso/app/user_profile/__pycache__/__init__.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user_profile/__pycache__/admin.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/__pycache__/admin.cpython-38.pyc index 1f0e340..08118cc 100644 Binary files a/rest-app/smartpicasso/app/user_profile/__pycache__/admin.cpython-38.pyc and b/rest-app/smartpicasso/app/user_profile/__pycache__/admin.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user_profile/__pycache__/models.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/__pycache__/models.cpython-38.pyc index 4815020..11e4dc9 100644 Binary files a/rest-app/smartpicasso/app/user_profile/__pycache__/models.cpython-38.pyc and b/rest-app/smartpicasso/app/user_profile/__pycache__/models.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/0001_initial.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/0001_initial.cpython-38.pyc index e354c63..94e7772 100644 Binary files a/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/0001_initial.cpython-38.pyc and b/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/0001_initial.cpython-38.pyc differ diff --git a/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/__init__.cpython-38.pyc index 8f1df47..48eab08 100644 Binary files a/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/__init__.cpython-38.pyc and b/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/__init__.cpython-38.pyc differ