urls.py 1.09 KB
Newer Older
1
import django_cas_ng.views
2
from django.conf import settings
Florent Chehab's avatar
Florent Chehab committed
3 4
from django.conf.urls import include, url
from django.contrib import admin
5
from django.views.generic.base import RedirectView
Florent Chehab's avatar
Florent Chehab committed
6

7
from base_app.views import media_files_view
8
from . import views
9 10 11

if settings.DEBUG:
    import debug_toolbar
12 13

    urlpatterns = [url(r"^__debug__/", include(debug_toolbar.urls))]
Florent Chehab's avatar
Florent Chehab committed
14 15
else:
    urlpatterns = []
16 17

urlpatterns += [
18
    url(r"^admin/", admin.site.urls),
Florent Chehab's avatar
Florent Chehab committed
19
    url(r"^user/login$", django_cas_ng.views.LoginView.as_view(), name="cas_ng_login"),
Florent Chehab's avatar
Florent Chehab committed
20 21 22 23 24 25 26 27
    url(
        r"^user/logout$", django_cas_ng.views.LogoutView.as_view(), name="cas_ng_logout"
    ),
    url(
        r"^user/callback$",
        django_cas_ng.views.CallbackView.as_view(),
        name="cas_ng_proxy_callback",
    ),
Florent Chehab's avatar
Florent Chehab committed
28
    url(r"^app/.*", views.index),
29 30
    url(r"^cgu-rgpd/.*", views.cgu_rgpd),
    url(r"^rgpd-raw/.*", views.rgpd_raw),
31
    url(r"^banned_note/", views.banned),
32 33
    url(r"^$", RedirectView.as_view(url="./app/"), name="go to real home"),
    url(r"", include("backend_app.urls")),
34 35
    url(r"^media/(?P<path>.*)", media_files_view, name="media"),
]