1 # -*- coding: utf-8 -*-
3 from django.conf.urls.defaults import *
4 from django.contrib import admin
5 from django.conf import settings
9 if 'cas_consumer' in settings.INSTALLED_APPS:
10 auth_views = 'cas_consumer.views'
12 auth_views = 'django.contrib.auth.views'
14 urlpatterns = patterns('',
15 url(r'^$', 'wiki.views.document_list'),
16 url(r'^gallery/(?P<directory>[^/]+)$', 'wiki.views.document_gallery'),
19 url(r'^accounts/login/$', auth_views + '.login', name = 'login'),
20 url(r'^accounts/logout/$', auth_views + '.logout', name = 'logout'),
23 (r'^admin/filebrowser/', include('filebrowser.urls')),
24 url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
25 url(r'^admin/(.*)', admin.site.root),
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}),
35 url(r'^(?P<name>[^/]+)$', 'wiki.views.document_detail'),