khaganat-web/neluser/urls.py

71 lines
2.1 KiB
Python
Raw Permalink Normal View History

from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy, path
from . import views
urlpatterns = [
# Login and logout
path(
2019-07-24 17:07:41 +00:00
"login/",
auth_views.LoginView.as_view(template_name="neluser/login.html"),
name="login",
),
path(
2019-07-24 17:07:41 +00:00
"logout/",
auth_views.LogoutView.as_view(next_page=reverse_lazy("index")),
name="logout",
),
# Account activation
2019-07-24 17:07:41 +00:00
path("register/", views.register, name="register"),
path("activate/<uidb64>/<token>/", views.activate, name="activate"),
# Forgotten password
path(
2019-07-24 17:07:41 +00:00
"forgotten_password/",
auth_views.PasswordResetView.as_view(
2019-07-24 17:07:41 +00:00
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",
),
2019-07-24 17:07:41 +00:00
name="password_reset",
),
path(
2019-07-24 17:07:41 +00:00
"forgotten_password/done/",
auth_views.PasswordResetDoneView.as_view(
2019-07-24 17:07:41 +00:00
template_name="neluser/password_reset_email_sent.html"
),
2019-07-24 17:07:41 +00:00
name="password_reset_done",
),
path(
2019-07-24 17:07:41 +00:00
"password/reset/<uidb64>/<token>/",
auth_views.PasswordResetConfirmView.as_view(
2019-07-24 17:07:41 +00:00
template_name="neluser/password_reset_confirm.html"
),
2019-07-24 17:07:41 +00:00
name="password_reset_confirm",
),
path(
2019-07-24 17:07:41 +00:00
"password/reset/done/",
auth_views.PasswordResetCompleteView.as_view(
2019-07-24 17:07:41 +00:00
template_name="neluser/password_reset_done.html"
),
2019-07-24 17:07:41 +00:00
name="password_reset_complete",
),
# --------
# Settings
# --------
2019-07-24 17:07:41 +00:00
path("settings/", views.settings_default, name="settings"),
# Preferences
2019-07-24 17:07:41 +00:00
path("settings/preferences/nsfw/", views.set_nsfw, name="set_nsfw"),
# Security
2018-11-08 19:11:14 +00:00
path(
2019-07-24 17:07:41 +00:00
"settings/security/password/",
2018-11-08 19:11:14 +00:00
views.ChangePasswordView.as_view(),
2019-07-24 17:07:41 +00:00
name="password_change",
2018-11-08 19:11:14 +00:00
),
path(
2019-07-24 17:07:41 +00:00
"settings/security/delete_account/",
2018-11-08 19:11:14 +00:00
views.DeleteAccountView.as_view(),
2019-07-24 17:07:41 +00:00
name="delete_account",
2018-11-08 19:11:14 +00:00
),
]