mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-25 10:33:45 +03:00
Updated project to Django 5.0.2 and made necessary changes to accommodate removed methods in this version.
- Added the orce_str method to the est_auth\serializers.py file. - Added the gettext_lazy method to the iews.py file. - Replaced url functions with path functions in the urlpatterns list. With these changes, I've updated the project to be compatible with the latest Django version and adjusted for removed methods, thereby enhancing project stability.
This commit is contained in:
parent
cdd04aa9be
commit
f1f434dce1
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'),
|
||||
]
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user