khaganat-web/neluser/urls.py
2018-06-02 21:43:23 +02:00

70 lines
2.1 KiB
Python

from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy, path
from . import views
from . import nsfw
urlpatterns = [
# login/logout
path(
'login/',
auth_views.LoginView.as_view(template_name='neluser/login.html'),
name='login'
),
path(
'logout/',
auth_views.LogoutView.as_view(next_page=reverse_lazy('index')),
name='logout'
),
# account activation
path('register/', views.register, name='register'),
path('activate/<uidb64>/<token>/', views.activate, name='activate'),
# settings
path('settings/', views.profile, name='settings'),
path('settings/password/', views.profile, name='password_change'),
path(
'settings/password/change/done/',
views.profile,
name='password_change_done'
),
# forgotten_password
path(
'forgotten_password/',
auth_views.PasswordResetView.as_view(
template_name='neluser/password_reset.html',
email_template_name='neluser/password_reset_email.txt',
html_email_template_name='neluser/password_reset_email.html',
subject_template_name='neluser/password_reset_email_subject.txt'
),
name='password_reset'
),
path(
'forgotten_password/done/',
auth_views.PasswordResetDoneView.as_view(
template_name='neluser/password_reset_email_sent.html'
),
name='password_reset_done'
),
path(
'password/reset/<uidb64>/<token>/',
auth_views.PasswordResetConfirmView.as_view(
template_name='neluser/password_reset_confirm.html'
),
name='password_reset_confirm'
),
path(
'password/reset/done/',
auth_views.PasswordResetCompleteView.as_view(
template_name='neluser/password_reset_done.html'
),
name='password_reset_complete'
),
# NSFW
path('nsfw/', nsfw.warn_view, name='nsfw'),
path('nsfw/enable/<max_age>/', nsfw.enable_view, name='enable_nsfw'),
path('nsfw/disable/', nsfw.disable_view, name='disable_nsfw'),
]