diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 4f99c18..6baa1a4 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -1,5 +1,5 @@ from django.http import HttpRequest -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.contrib.auth import get_user_model try: diff --git a/rest_auth/registration/views.py b/rest_auth/registration/views.py index 0e0ab0d..bab1c1c 100644 --- a/rest_auth/registration/views.py +++ b/rest_auth/registration/views.py @@ -1,6 +1,6 @@ from django.conf import settings from django.utils.decorators import method_decorator -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views.decorators.debug import sensitive_post_parameters from rest_framework.views import APIView diff --git a/rest_auth/serializers.py b/rest_auth/serializers.py index b645231..e540830 100644 --- a/rest_auth/serializers.py +++ b/rest_auth/serializers.py @@ -3,8 +3,8 @@ from django.conf import settings from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm from django.contrib.auth.tokens import default_token_generator from django.utils.http import urlsafe_base64_decode as uid_decoder -from django.utils.translation import ugettext_lazy as _ -from django.utils.encoding import force_text +from django.utils.translation import gettext_lazy as _ +from django.utils.encoding import force_str from rest_framework import serializers, exceptions from rest_framework.exceptions import ValidationError diff --git a/rest_auth/tests/mixins.py b/rest_auth/tests/mixins.py index 30b3d58..ac79cca 100644 --- a/rest_auth/tests/mixins.py +++ b/rest_auth/tests/mixins.py @@ -2,7 +2,7 @@ import json from django.conf import settings from django.test.client import Client, MULTIPART_CONTENT -from django.utils.encoding import force_text +from django.utils.encoding import force_str from rest_framework import status from rest_framework import permissions diff --git a/rest_auth/tests/test_api.py b/rest_auth/tests/test_api.py index 9c5fd9e..a21c1ba 100644 --- a/rest_auth/tests/test_api.py +++ b/rest_auth/tests/test_api.py @@ -2,7 +2,7 @@ from django.test import TestCase, override_settings from django.contrib.auth import get_user_model from django.core import mail from django.conf import settings -from django.utils.encoding import force_text +from django.utils.encoding import force_str from allauth.account import app_settings as account_app_settings from rest_framework import status diff --git a/rest_auth/urls.py b/rest_auth/urls.py index 7a35e9b..ffb6f94 100644 --- a/rest_auth/urls.py +++ b/rest_auth/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import url +from django.urls import path from rest_auth.views import ( LoginView, LogoutView, UserDetailsView, PasswordChangeView, @@ -7,14 +7,14 @@ from rest_auth.views import ( urlpatterns = [ # URLs that do not require a session or valid token - url(r'^password/reset/$', PasswordResetView.as_view(), + path('password/reset/', PasswordResetView.as_view(), name='rest_password_reset'), - url(r'^password/reset/confirm/$', PasswordResetConfirmView.as_view(), + path('password/reset/confirm/', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), - url(r'^login/$', LoginView.as_view(), name='rest_login'), + path('login/', LoginView.as_view(), name='rest_login'), # URLs that require a user to be logged in with a valid session / token. - url(r'^logout/$', LogoutView.as_view(), name='rest_logout'), - url(r'^user/$', UserDetailsView.as_view(), name='rest_user_details'), - url(r'^password/change/$', PasswordChangeView.as_view(), + path('logout/', LogoutView.as_view(), name='rest_logout'), + path('user/', UserDetailsView.as_view(), name='rest_user_details'), + path('password/change/', PasswordChangeView.as_view(), name='rest_password_change'), -] +] \ No newline at end of file diff --git a/rest_auth/views.py b/rest_auth/views.py index 0a0a982..d436fdd 100644 --- a/rest_auth/views.py +++ b/rest_auth/views.py @@ -6,7 +6,7 @@ from django.conf import settings from django.contrib.auth import get_user_model from django.core.exceptions import ObjectDoesNotExist from django.utils.decorators import method_decorator -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views.decorators.debug import sensitive_post_parameters from rest_framework import status