pflaenz.li/pflaenzli/pflaenzli/urls.py
Jannis Portmann c39872e5ea
Some checks reported errors
continuous-integration/drone/push Build was killed
Protect trade with CSRF
2023-05-18 14:24:47 +02:00

46 lines
2.6 KiB
Python

from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth import views as auth_views
from django.contrib.sitemaps.views import sitemap
from django.urls import include, path
from django.views.generic import TemplateView
from . import views
from .sitemaps import StaticViewSitemap
sitemaps = {
'static': StaticViewSitemap,
}
urlpatterns = [
path("", TemplateView.as_view(template_name='app/index.html'), name="index"),
path("offers/", views.list_offers, name="list_offers"),
path("offer/create/", views.create_offer, name="create_offer"),
path("offer/<int:offer_id>/", views.offer_detail, name="offer_detail"),
path("offer/<int:offer_id>/delete/", views.offer_delete, name="offer_delete"),
path("offer/<int:offer_id>/edit/", views.offer_edit, name="offer_edit"),
path("trade/", views.offer_trade, name="offer_trade"),
path("accounts/<int:user_id>", views.user_detail, name="user_detail"),
path("accounts/<int:user_id>/wishlist/", views.wishlist, name="wishlist"),
path('accounts/login/', auth_views.LoginView.as_view(template_name='registration/login.html')),
path('accounts/profile/', auth_views.LoginView.as_view(template_name='user/detail.html'), name='user_profile'),
path('accounts/profile/edit', views.user_edit, name='user_edit'),
path('accounts/register/', views.register_user, name='register_user'),
path('accounts/password_reset/', auth_views.PasswordResetView.as_view(template_name='registration/verify_email.html',
extra_context={'form_helper': settings.CRISPY_TEMPLATE_PACK}), name='password_reset'),
path('accounts/password_reset/done/',
auth_views.PasswordResetDoneView.as_view(template_name='registration/verify_email_done.html')),
path('accounts/reset/<uidb64>/<token>/',
auth_views.PasswordResetConfirmView.as_view(template_name='registration/password_reset_confirm.html', extra_context={'form_helper': settings.CRISPY_TEMPLATE_PACK})),
path('accounts/reset/<uidb64>/<token>/',
auth_views.PasswordResetCompleteView.as_view(template_name='registration/password_reset_complete.html')),
path('accounts/', include('django.contrib.auth.urls')),
path("faq/", TemplateView.as_view(template_name='app/faq.html'), name="faq"),
path("imprint/", TemplateView.as_view(template_name='app/imprint.html'), name="imprint"),
path("wish/delete/<str:wish_id>", views.delete_wish, name='delete_wish'),
path("i18n/", include("django.conf.urls.i18n")),
path('sitemap.xml', sitemap, {'sitemaps': sitemaps},
name='django.contrib.sitemaps.views.sitemap'),
]