-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from jdeanwallace/update-example-24db1ebb4c02f…
…3fcfe830cd928a07a0af1761870 Update example project
- Loading branch information
Showing
23 changed files
with
168 additions
and
742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .view_urls import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
from django.urls import path | ||
|
||
from .. import views | ||
from apps.accounts import views | ||
|
||
|
||
app_name = 'accounts-api' | ||
urlpatterns = [ | ||
path('auth/token/', views.AuthTokenView.as_view(), name='auth-token'), | ||
] | ||
urlpatterns = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from django.urls import path | ||
|
||
from .. import views | ||
from apps.accounts import views | ||
|
||
|
||
app_name = "accounts" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +0,0 @@ | ||
import logging | ||
|
||
from rest_framework import views, permissions, response | ||
from rest_framework.response import Response | ||
from rest_framework.authtoken.models import Token | ||
|
||
from . import serializers | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# Create your views here. | ||
class AuthTokenView(views.APIView): | ||
permission_classes = (permissions.AllowAny,) | ||
serializer_class = serializers.AuthTokenSerializer | ||
|
||
def post(self, request, *args, **kwargs): | ||
serializer = self.serializer_class(data=request.data) | ||
serializer.is_valid(raise_exception=True) | ||
user = serializer.validated_data['user'] | ||
token, created = Token.objects.get_or_create(user=user) | ||
return Response({'token': token.key}) | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.