urls.py 3.09 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 patterns, 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 25
from django.shortcuts import redirect

26

27
from circle.settings.base import get_env_variable
Őry Máté committed
28
from dashboard.views import circle_login, HelpView
29
from dashboard.forms import CirclePasswordResetForm, CircleSetPasswordForm
30
from firewall.views import add_blacklist_item
31

32 33
admin.autodiscover()

Kálmán Viktor committed
34 35
urlpatterns = patterns(
    '',
36

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

43 44 45
    # 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})/$'),
46 47 48 49 50 51 52 53 54
        'django.contrib.auth.views.password_reset_confirm',
        {'set_password_form': CircleSetPasswordForm},
        name='accounts.password_reset_confirm'
        ),
    url(r'^accounts/password/reset/$', ("django.contrib.auth.views."
                                        "password_reset"),
        {'password_reset_form': CirclePasswordResetForm},
        name="accounts.password-reset",
        ),
55
    url(r'^accounts/login/?$', circle_login, name="accounts.login"),
56
    url(r'^accounts/', include('django.contrib.auth.urls')),
Őry Máté committed
57
    url(r'^info/help/$', HelpView.as_view(template_name="info/help.html"),
58 59 60 61 62 63 64 65 66 67
        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"),
68
)
69 70


Bach Dániel committed
71 72 73 74 75 76
if 'rosetta' in settings.INSTALLED_APPS:
    urlpatterns += patterns(
        '',
        url(r'^rosetta/', include('rosetta.urls')),
    )

77 78 79 80 81 82
if settings.ADMIN_ENABLED:
    urlpatterns += patterns(
        '',
        url(r'^admin/', include(admin.site.urls)),
    )

Bach Dániel committed
83

84 85 86 87 88
if get_env_variable('DJANGO_SAML', 'FALSE') == 'TRUE':
    urlpatterns += patterns(
        '',
        (r'^saml2/', include('djangosaml2.urls')),
    )
89 90

handler500 = 'common.views.handler500'