urls.py 3.28 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Copyright 2014 Budapest University of Technology and Economics (BME IK)
#
# This file is part of CIRCLE Cloud.
#
# CIRCLE is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# CIRCLE is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
# with CIRCLE.  If not, see <http://www.gnu.org/licenses/>.

18
from django.conf.urls import include, url
19
from django.views.generic import TemplateView
20

Bach Dániel committed
21
from django.conf import settings
22
from django.contrib import admin
23
from django.core.urlresolvers import reverse
Bach Dániel committed
24
from django.shortcuts import redirect
25 26 27
from django.contrib.auth.views import (
    password_reset_confirm, password_reset
)
Bach Dániel committed
28

29

30
from circle.settings.base import get_env_variable
31 32 33
from dashboard.views import (
    CircleLoginView, HelpView, ResizeHelpView, TwoFactorLoginView
)
34
from dashboard.forms import CirclePasswordResetForm, CircleSetPasswordForm
35
from firewall.views import add_blacklist_item
36

37 38
admin.autodiscover()

39
urlpatterns = [
40
    url(r'^$', lambda x: redirect(reverse("dashboard.index"))),
41
    url(r'^network/', include('network.urls')),
42
    url(r'^blacklist-add/', add_blacklist_item),
43
    url(r'^dashboard/', include('dashboard.urls')),
Kálmán Viktor committed
44
    url(r'^request/', include('request.urls')),
45

46 47 48
    # django/contrib/auth/urls.py (care when new version)
    url((r'^accounts/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/'
         r'(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$'),
49
        password_reset_confirm,
50 51 52
        {'set_password_form': CircleSetPasswordForm},
        name='accounts.password_reset_confirm'
        ),
53
    url(r'^accounts/password/reset/$', password_reset,
54 55 56
        {'password_reset_form': CirclePasswordResetForm},
        name="accounts.password-reset",
        ),
57 58
    url(r'^accounts/login/?$', CircleLoginView.as_view(),
        name="accounts.login"),
59
    url(r'^accounts/', include('django.contrib.auth.urls')),
60 61 62
    url(r'^two-factor-login/$', TwoFactorLoginView.as_view(),
        name="two-factor-login"),

Őry Máté committed
63
    url(r'^info/help/$', HelpView.as_view(template_name="info/help.html"),
64 65 66 67 68 69 70 71 72 73
        name="info.help"),
    url(r'^info/policy/$',
        TemplateView.as_view(template_name="info/policy.html"),
        name="info.policy"),
    url(r'^info/legal/$',
        TemplateView.as_view(template_name="info/legal.html"),
        name="info.legal"),
    url(r'^info/support/$',
        TemplateView.as_view(template_name="info/support.html"),
        name="info.support"),
74 75
    url(r'^info/resize-how-to/$', ResizeHelpView.as_view(),
        name="info.resize"),
76
]
77 78


Bach Dániel committed
79
if 'rosetta' in settings.INSTALLED_APPS:
80
    urlpatterns += [
Bach Dániel committed
81
        url(r'^rosetta/', include('rosetta.urls')),
82
    ]
Bach Dániel committed
83

84
if settings.ADMIN_ENABLED:
85
    urlpatterns += [
86
        url(r'^admin/', include(admin.site.urls)),
87
    ]
88

Bach Dániel committed
89

90
if get_env_variable('DJANGO_SAML', 'FALSE') == 'TRUE':
91
    urlpatterns += [
Czémán Arnold committed
92
        url(r'^saml2/', include('djangosaml2.urls')),
93
    ]
94 95

handler500 = 'common.views.handler500'
96
handler403 = 'common.views.handler403'