Exemple #1
0
from django.conf.urls import url
from django.views.generic import TemplateView
from django.contrib.auth import views

from auth.views import (RegistrationView, LoginView, LogoutView,
                        ProfileDetailView, ProfileUpdateView)

urlpatterns = [
    url(r'^login/$',
        LoginView.as_view(template_name="auth/login.html"),
        name='auth_login'),
    url(r'^logout/$', LogoutView.as_view(), name='auth_logout'),
    url(r'^auth/profile$',
        ProfileUpdateView.as_view(template_name="auth/update.html"),
        name='auth_profile_update'),
    url(r'^register/$',
        RegistrationView.as_view(template_name="auth/register.html"),
        name='auth_registration'),
    url(r'^complete/$',
        TemplateView.as_view(template_name="auth/complete.html"),
        name='auth_registration_complete'),
    url(r'^users/(?P<username>[\w\._-]+)$',
        ProfileDetailView.as_view(template_name="auth/profile.html"),
        name='auth_profile'),
]
Exemple #2
0
from rest_framework_simplejwt.views import TokenRefreshView, TokenObtainPairView
from auth.views import RegisterView, UpdateUserView, ChangePasswordView, LogoutView, LogoutAllView
from django.urls import path

# We previously changed the token obtain url to add custom claim.
# But blacklist app not compatible with custom claim.
# For this reason, we’ll change urls.py and we’ll use default views.

urlpatterns = [
    path('login/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('login/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
    path('register/', RegisterView.as_view(), name='auth_register'),
    path('change_password/<int:pk>/',
         ChangePasswordView.as_view(),
         name='auth_change_password'),
    path('update_profile/<int:pk>/',
         UpdateUserView.as_view(),
         name='auth_update_profile'),
    path('logout/', LogoutView.as_view(), name='auth_logout'),
    path('logout_all/', LogoutAllView.as_view(), name='auth_logout_all'),
]
Exemple #3
0
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from auth.views import RegistrationView, LoginView, LogoutView, ProfileDetailView


urlpatterns = patterns(
    "",
    url(r"^login/$", LoginView.as_view(template_name="auth/login.html"), name="auth_login"),
    url(r"^logout/$", LogoutView.as_view(), name="auth_logout"),
    url(r"^register/$", RegistrationView.as_view(template_name="auth/register.html"), name="auth_registration"),
    url(r"^complete/$", TemplateView.as_view(template_name="auth/complete.html"), name="auth_registration_complete"),
    url(
        r"^profile/(?P<username>[\w\._-]+)/$",
        ProfileDetailView.as_view(template_name="auth/profile.html"),
        name="auth_profile",
    ),
)
Exemple #4
0
    TokenVerifyView
)

from django.conf import settings
from auth.views import LoginView, LogoutView

rest_auth_registration_urls = [
    # allauth login/logout/password
    re_path(r"^registration/$", RegisterView.as_view(), name="account_signup"),
    re_path(r"^registration/verify-email/$",VerifyEmailView.as_view(),name="rest_verify_email",)
]


urlpatterns = [
    # rest_auth login/logout/password
    re_path(r"^login/$", LoginView.as_view(), name="rest_login"),
    re_path(r"^logout/$", LogoutView.as_view(), name="rest_logout"),
    re_path(r"^password/reset/$", PasswordResetView.as_view(), name="rest_password_reset"),
    re_path(r"^password/reset/confirm/$",PasswordResetConfirmView.as_view(),name="rest_password_reset_confirm",),
    re_path(r"^password/change/$", PasswordChangeView.as_view(), name="rest_password_change" ),

    #rest_framework_simplejwt
    re_path(r"^token/obtain/$", TokenObtainPairView.as_view(), name='token_obtain_pair'),
    re_path(r"^token/refresh/$", TokenRefreshView.as_view(), name='token_refresh'),
    re_path(r"^token/verify/$", TokenVerifyView.as_view(), name='token_verify'),

]

if settings.AUTH_ALLOW_REGISTRATION:
    urlpatterns += rest_auth_registration_urls
Exemple #5
0
from django.conf.urls import url

from auth.views import LoginView, LogoutView

urlpatterns = [
    url(r'^login$', LoginView.as_view()),
    url(r'^logout$', LogoutView.as_view()),
]
Exemple #6
0
    path('login/refresh/', TokenRefreshView.as_view(), name='token_refresh'),

    path(
        'dashboard/change_password/<key>/',
        ChangePasswordView.as_view(), name='auth_change_password'),

    path(
        'dashboard/update_profile/<key>/',
        UpdateProfileView.as_view(), name='auth_update_profile'),

    path(
        'dashboard/change_image/<key>/',
        UpdateUserImageView.as_view(), name='auth_image'),

    path(
        'dashboard/logout/', LogoutView.as_view(), name='auth_logout'),
    path(
        'dashboard/delete_profile/<key>/',
        DeleteProfileView.as_view(), name='auth_delete_profile'),

    path(
        'forgot_password/',
        ForgotPasswordView.as_view(),
        name='auth_forgot_password'),

    path(
        'confirm/', ValidateConfirmationCodeView.as_view(),
        name='auth_confirm'),

    path(
        'reset_password/<key>',
Exemple #7
0
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from auth.views import RegistrationView, LoginView, LogoutView, ProfileDetailView


urlpatterns = patterns('',

    url(r'^login/$', LoginView.as_view(template_name="auth/login.html"), name='auth_login'),
    url(r'^logout/$', LogoutView.as_view(), name='auth_logout'),
    url(r'^register/$', RegistrationView.as_view(
        template_name="auth/register.html"), name='auth_registration'),
    url(r'^complete/$', TemplateView.as_view(
        template_name="auth/complete.html"), name='auth_registration_complete'),
    url(r'^profile/(?P<username>[-\w]+)/$', ProfileDetailView.as_view(
        template_name="auth/profile.html"), name='auth_profile'),

)