Skip to content

Commit

Permalink
Merge 8b9ab4c into c7accd4
Browse files Browse the repository at this point in the history
  • Loading branch information
dorothyas committed Apr 1, 2019
2 parents c7accd4 + 8b9ab4c commit 1a8d6cd
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ coverage = "*"
gunicorn = "*"
django-heroku = "*"
pipenv-to-requirements = "*"
django-rest-swagger = "*"

[requires]
python_version = "3.6.5"
6 changes: 3 additions & 3 deletions authors/apps/authentication/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from rest_framework import status
from rest_framework.generics import RetrieveUpdateAPIView
from rest_framework.generics import RetrieveUpdateAPIView, GenericAPIView
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
Expand All @@ -10,7 +10,7 @@
)


class RegistrationAPIView(APIView):
class RegistrationAPIView(GenericAPIView):
# Allow any user (authenticated or not) to hit this endpoint.
permission_classes = (AllowAny,)
renderer_classes = (UserJSONRenderer,)
Expand All @@ -28,7 +28,7 @@ def post(self, request):
return Response(serializer.data, status=status.HTTP_201_CREATED)


class LoginAPIView(APIView):
class LoginAPIView(GenericAPIView):
permission_classes = (AllowAny,)
renderer_classes = (UserJSONRenderer,)
serializer_class = LoginSerializer
Expand Down
3 changes: 1 addition & 2 deletions authors/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

'corsheaders',
'django_extensions',
'rest_framework',

'rest_framework_swagger',
'authors.apps.authentication',
'authors.apps.core',
'authors.apps.profiles',
Expand Down
5 changes: 4 additions & 1 deletion authors/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from django.urls import include, path
from django.contrib import admin
from rest_framework_swagger.views import get_swagger_view

schema_view = get_swagger_view(title="Authors' Haven")

app_name = "Authors' Haven"

urlpatterns = [
path('admin/', admin.site.urls),

path('swagger-docs/', schema_view),
path('api/', include('authors.apps.authentication.urls')),
]

13 changes: 13 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
################################################################################
# This requirements file has been automatically generated from `Pipfile` with
# `pipenv-to-requirements`
#
#
# This has been done to maintain backward compatibility with tools and services
# that do not support `Pipfile` yet.
#
# Do NOT edit it directly, use `pipenv install [-d]` to modify `Pipfile` and
# `Pipfile.lock` and then regenerate `requirements*.txt`.
################################################################################

pylint
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ django
django-cors-headers
django-extensions
django-heroku
django-rest-swagger
djangorestframework
gunicorn
jwt
Expand Down

0 comments on commit 1a8d6cd

Please sign in to comment.