You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
2.3 KiB
40 lines
2.3 KiB
from django.urls import path, re_path, include
|
|
from django.contrib.auth import views as auth_views
|
|
from django.views.generic.base import TemplateView
|
|
|
|
from . import views
|
|
|
|
app_name = 'news'
|
|
urlpatterns = [
|
|
# Static
|
|
path('contact', TemplateView.as_view(template_name='news/static/contact.html'), name='contact'),
|
|
path('about', TemplateView.as_view(template_name='news/static/about.html'), name='about'),
|
|
# Posts
|
|
path('', views.index, name='index'),
|
|
path('<int:post_id>/comment', views.comment, name='comment'),
|
|
path('<int:post_id>/comment/<int:comment_id>', views.comment_with_parent, name='comment_with_parent'),
|
|
path("<int:post_id>/<slug:post_slug>", views.post, name="post"),
|
|
# path('<int:post_id>', views.post, name='post'),
|
|
path('comment/<int:comment_id>/delete', views.delete_comment, name='delete_comment'),
|
|
path('upvote/<int:comment_id>', views.upvote, name='upvote'),
|
|
path('submission', views.submission, name='submission'),
|
|
path('submitted', views.submitted, name='submitted'),
|
|
# User
|
|
path('account', views.account, name='account'),
|
|
path('signin', views.signin, name='signin'),
|
|
path('logout', views.logout_view, name='logout_view'),
|
|
path('password-change', views.password_change, name='password_change'),
|
|
re_path(r'^register/$', views.register, name='register'),
|
|
path('password_reset/', auth_views.PasswordResetView.as_view(
|
|
template_name='news/user/password_reset_form.html',
|
|
email_template_name='news/user/password_reset_email.html',
|
|
html_email_template_name='news/user/password_reset_html_email.html',
|
|
subject_template_name='news/user/password_reset_subject.txt',
|
|
success_url='../password-reset/done'
|
|
), name='password_reset'),
|
|
path('password-reset/done', auth_views.PasswordResetDoneView.as_view(template_name='news/user/password_reset_done.html'), name='password_reset_done'),
|
|
path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(
|
|
template_name='news/user/password_reset_confirm.html',
|
|
success_url='password-change/done'), name='password_reset_confirm'),
|
|
path('reset/<uidb64>/set-password/password-change/done', auth_views.PasswordResetCompleteView.as_view(template_name='news/user/password_reset_complete.html'), name='password_change_done'),
|
|
]
|
|
|