1abc89929fc51d0cce52c7b3cf1fea2091292c0d
[redakcja.git] / platforma / urls.py
1 # -*- coding: utf-8 -*-
2
3 from django.conf.urls.defaults import *
4 from django.contrib import admin
5 from django.conf import settings
6
7 admin.autodiscover()
8
9 if 'cas_consumer' in settings.INSTALLED_APPS:
10     auth_views = 'cas_consumer.views'
11 else:
12     auth_views = 'django.contrib.auth.views'
13
14 urlpatterns = patterns('',
15     url(r'^$', 'wiki.views.document_list'),
16     url(r'^gallery/(?P<directory>[^/]+)$', 'wiki.views.document_gallery'),
17
18     # Auth
19     url(r'^accounts/login/$', auth_views + '.login', name = 'login'),
20     url(r'^accounts/logout/$', auth_views + '.logout', name = 'logout'),
21
22     # Admin panel
23     (r'^admin/filebrowser/', include('filebrowser.urls')),
24     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
25     url(r'^admin/(.*)', admin.site.root),
26
27     # Static files (should be served by Apache)
28     url(r'^%s(?P<path>.+)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
29         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
30     url(r'^%s(?P<path>.+)$' % settings.ADMIN_MEDIA_PREFIX[1:], 'django.views.static.serve',
31         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
32     url(r'^%s(?P<path>.+)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
33         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
34
35     url(r'^(?P<name>[^/]+)$', 'wiki.views.document_detail'),
36 )