urls.py 2.5 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
Kálmán Viktor committed
19
# from django.views.generic import TemplateView
20 21

from django.contrib import admin
22 23
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
24

25
from circle.settings.base import get_env_variable
26
from dashboard.views import circle_login
27
from dashboard.forms import CirclePasswordResetForm, CircleSetPasswordForm
28

29 30
admin.autodiscover()

Kálmán Viktor committed
31 32
urlpatterns = patterns(
    '',
Bach Dániel committed
33
    # url(r'^$', TemplateView.as_view(template_name='base.html')),
34 35 36 37 38 39 40

    # Examples:
    # url(r'^$', 'circle.views.home', name='home'),
    # url(r'^circle/', include('circle.foo.urls')),

    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

41
    url(r'^$', lambda x: redirect(reverse("dashboard.index"))),
42
    url(r'^admin/', include(admin.site.urls)),
43
    url(r'^network/', include('network.urls')),
44
    url(r'^dashboard/', include('dashboard.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 50 51 52 53 54 55 56 57
        '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",
        ),
58
    url(r'^accounts/login/?$', circle_login, name="accounts.login"),
59
    url(r'^accounts/', include('django.contrib.auth.urls')),
60
)
61 62 63 64 65 66 67


if get_env_variable('DJANGO_SAML', 'FALSE') == 'TRUE':
    urlpatterns += patterns(
        '',
        (r'^saml2/', include('djangosaml2.urls')),
    )
68 69

handler500 = 'common.views.handler500'