2ecb7ed44aaa52908554383e0ac757dbfa232d50
[redakcja.git] / src / redakcja / urls.py
1 # -*- coding: utf-8 -*-
2
3 from django.conf.urls import include, url
4 from django.contrib import admin
5 from django.conf import settings
6 from django.conf.urls.static import static
7 from django.contrib.staticfiles.urls import staticfiles_urlpatterns
8 from django.views.generic import RedirectView
9 import django_cas_ng.views
10
11
12 urlpatterns = [
13     # Auth
14     url(r'^accounts/login/$', django_cas_ng.views.LoginView.as_view(), name='cas_ng_login'),
15     url(r'^accounts/logout/$', django_cas_ng.views.LogoutView.as_view(), name='logout'),
16     #url(r'^admin/login/$', django_cas_ng.views.login, name='login'),
17     #url(r'^admin/logout/$', django_cas_ng.views.logout, name='logout'),
18
19     # Admin panel
20     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
21     url(r'^admin/', admin.site.urls),
22
23     url(r'^$', RedirectView.as_view(url= '/documents/', permanent=False)),
24     url(r'^documents/', include('catalogue.urls')),
25     url(r'^apiclient/', include('apiclient.urls')),
26     url(r'^editor/', include('wiki.urls')),
27     url(r'^images/', include('wiki_img.urls')),
28     url(r'^cover/', include('cover.urls')),
29 ]
30
31 if settings.DEBUG:
32     urlpatterns += staticfiles_urlpatterns()
33     urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
34
35     import debug_toolbar
36     urlpatterns += (url(r'^__debug__/', include(debug_toolbar.urls))),