urls.py 1.05 KB
Newer Older
1 2
from django.conf import settings
from django.conf.urls.static import static
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
import django_cas_ng.views
7
from . import views
Florent Chehab's avatar
Florent Chehab committed
8 9 10 11 12 13

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

urlpatterns += [
18 19
    # TODO remove this before going to full prod
    url(r'^role_change/', views.role_change),
Florent Chehab's avatar
Florent Chehab committed
20
    url(r'^admin/', admin.site.urls),
Florent Chehab's avatar
Florent Chehab committed
21
    url(r'^user/login$',
Florent Chehab's avatar
Florent Chehab committed
22
        django_cas_ng.views.login,
Florent Chehab's avatar
Florent Chehab committed
23
        name='cas_ng_login'),
Florent Chehab's avatar
Florent Chehab committed
24
    url(r'^user/logout$',
Florent Chehab's avatar
Florent Chehab committed
25
        django_cas_ng.views.logout,
Florent Chehab's avatar
Florent Chehab committed
26
        name='cas_ng_logout'),
Florent Chehab's avatar
Florent Chehab committed
27
    url(r'^user/callback$',
Florent Chehab's avatar
Florent Chehab committed
28
        django_cas_ng.views.callback,
Florent Chehab's avatar
Florent Chehab committed
29
        name='cas_ng_proxy_callback'),
Florent Chehab's avatar
Florent Chehab committed
30
    url(r'^app/.*', include('frontend_app.urls')),
31
    url(r'^$', RedirectView.as_view(url='./app/'), name='go to real home'),
Florent Chehab's avatar
Florent Chehab committed
32
    url(r'', include('backend_app.urls')),
33
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)