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

Florent Chehab's avatar
Florent Chehab committed
7
import django_cas_ng.views
Florent Chehab's avatar
Florent Chehab committed
8

9
from . import views
10 11 12

if settings.DEBUG:
    import debug_toolbar
13 14

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

urlpatterns += [
19
    url(r"^admin/", admin.site.urls),
Florent Chehab's avatar
Florent Chehab committed
20
    url(r"^user/login$", django_cas_ng.views.LoginView.as_view(), name="cas_ng_login"),
Florent Chehab's avatar
Florent Chehab committed
21 22 23 24 25 26 27 28
    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
29
    url(r"^app/.*", views.index),
30 31
    url(r"^$", RedirectView.as_view(url="./app/"), name="go to real home"),
    url(r"", include("backend_app.urls")),
32
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)