aboutsummaryrefslogtreecommitdiffstats
path: root/urls.py
blob: db9495980053aac917b20a656df6f142a1c5ae45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# layerindex-web - URLs
#
# Based on the Django project template
#
# Copyright (c) Django Software Foundation and individual contributors.
# All rights reserved.
#
# SPDX-License-Identifier: MIT

from django.urls import include, re_path, reverse_lazy
from django.views.generic import RedirectView, TemplateView
from layerindex.auth_views import CaptchaRegistrationView, CaptchaPasswordResetView, delete_account_view, \
    PasswordResetSecurityQuestions
from django.contrib import admin
admin.autodiscover()

import settings

urlpatterns = [
    re_path(r'^layerindex/', include('layerindex.urls')),
    re_path(r'^admin/', admin.site.urls),
    re_path(r'^accounts/password_reset/$',
        CaptchaPasswordResetView.as_view(
            email_template_name='registration/password_reset_email.txt',
            success_url=reverse_lazy('password_reset_done')),
        name='password_reset'),
    re_path(r'^accounts/register/$', CaptchaRegistrationView.as_view(),
        name='django_registration_register'),
    re_path(r'^accounts/delete/$', delete_account_view,
        {'template_name': 'layerindex/deleteaccount.html'},
        name='delete_account'),
    re_path(r'^accounts/reregister/$', TemplateView.as_view(
        template_name='registration/reregister.html'),
        name='reregister'),
    re_path(r'^accounts/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,3}-[0-9A-Za-z]{1,20})/$',
        PasswordResetSecurityQuestions.as_view(),
        name='password_reset_confirm',
        ),
    re_path(r'^accounts/reset/fail/$', TemplateView.as_view(
        template_name='registration/password_reset_fail.html'),
        name='password_reset_fail'),
    re_path(r'^accounts/lockout/$', TemplateView.as_view(
        template_name='registration/account_lockout.html'),
        name='account_lockout'),
    re_path(r'^accounts/', include('django_registration.backends.activation.urls')),
    re_path(r'^accounts/', include('django.contrib.auth.urls')),
    re_path(r'^captcha/', include('captcha.urls')),
]
if 'rrs' in settings.INSTALLED_APPS:
    urlpatterns += [
        re_path(r'^rrs/', include('rrs.urls')),
    ]

urlpatterns += [
    re_path(r'.*', RedirectView.as_view(url='/layerindex/', permanent=False)),
]