Skip to content

Commit

Permalink
Merge pull request #34 from jdeanwallace/update-example-24db1ebb4c02f…
Browse files Browse the repository at this point in the history
…3fcfe830cd928a07a0af1761870

Update example project
  • Loading branch information
jdeanwallace authored Sep 23, 2023
2 parents 6e07e60 + 180a8d4 commit 283e028
Show file tree
Hide file tree
Showing 23 changed files with 168 additions and 742 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 0 additions & 2 deletions apps/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from django.utils.translation import gettext_lazy as _
from django.core.validators import validate_email

from apps.utils.validators import validate_uuid4


User = get_user_model()

Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/management/commands/changepassword.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Command(BaseCommand):
help = "Change a user's password for django.contrib.auth."
requires_migrations_checks = True
requires_system_checks = False
requires_system_checks = []

def _get_pass(self, prompt="Password: "):
p = getpass.getpass(prompt=prompt)
Expand Down
3 changes: 1 addition & 2 deletions apps/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from django.utils import timezone
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.utils.translation import gettext_lazy as _

from apps.utils.models import CreatedModifiedModel
from django.core.mail import send_mail

from .managers import UserManager

Expand Down
34 changes: 0 additions & 34 deletions apps/accounts/serializers.py

This file was deleted.

91 changes: 0 additions & 91 deletions apps/accounts/tests.py

This file was deleted.

1 change: 1 addition & 0 deletions apps/accounts/urls/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .view_urls import *
6 changes: 2 additions & 4 deletions apps/accounts/urls/api_urls.py
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 = []
2 changes: 1 addition & 1 deletion apps/accounts/urls/view_urls.py
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"
Expand Down
23 changes: 0 additions & 23 deletions apps/accounts/views.py
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})
3 changes: 0 additions & 3 deletions apps/utils/admin.py

This file was deleted.

125 changes: 0 additions & 125 deletions apps/utils/rest_framework.py

This file was deleted.

Loading

0 comments on commit 283e028

Please sign in to comment.