1 # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from django.conf.urls import include, url
5 from django.contrib import admin
6 from django.conf import settings
7 from django.conf.urls.static import static
8 from django.contrib.staticfiles.urls import staticfiles_urlpatterns
9 from django.views.generic import RedirectView
10 import django_cas_ng.views
15 #url(r'^admin/login/$', django_cas_ng.views.login, name='login'),
16 #url(r'^admin/logout/$', django_cas_ng.views.logout, name='logout'),
19 url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
20 url(r'^admin/', admin.site.urls),
22 url(r'^$', RedirectView.as_view(url='/documents/', permanent=False)),
23 url(r'^documents/', include('documents.urls')),
24 url(r'^apiclient/', include('apiclient.urls')),
25 url(r'^editor/', include('wiki.urls')),
26 url(r'^images/', include('wiki_img.urls')),
27 url(r'^cover/', include('cover.urls')),
31 if settings.CAS_SERVER_URL:
33 url(r'^accounts/login/$', django_cas_ng.views.LoginView.as_view(), name='cas_ng_login'),
34 url(r'^accounts/logout/$', django_cas_ng.views.LogoutView.as_view(), name='logout'),
37 import django.contrib.auth.views
39 url(r'^accounts/login/$', django.contrib.auth.views.LoginView.as_view(), name='cas_ng_login'),
40 url(r'^accounts/', include('django.contrib.auth.urls')),
45 urlpatterns += staticfiles_urlpatterns()
46 urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
49 urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]