3fd6ff523ddeedb9ee9627dc530ba2aaeed98073
[redakcja.git] / redakcja / 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 import wiki.urls
8
9 admin.autodiscover()
10
11 urlpatterns = patterns('',
12     # Auth
13     url(r'^accounts/login/$', 'django_cas.views.login', name='login'),
14     url(r'^accounts/logout/$', 'django_cas.views.logout', name='logout'),
15
16     # Admin panel
17     (r'^admin/filebrowser/', include('filebrowser.urls')),
18     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
19     (r'^admin/', include(admin.site.urls)),
20
21     (r'^comments/', include('django.contrib.comments.urls')),
22
23     url(r'^$', 'django.views.generic.simple.redirect_to', {'url': '/documents/'}),
24     url(r'^documents/', include('wiki.urls')),
25     url(r'^storage/', include('dvcs.urls')),
26     url(r'^apiclient/', include('apiclient.urls')),
27
28     # Static files (should be served by Apache)
29     url(r'^%s(?P<path>.+)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
30         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
31     url(r'^%s(?P<path>.+)$' % settings.ADMIN_MEDIA_PREFIX[1:], 'django.views.static.serve',
32         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
33     url(r'^%s(?P<path>.+)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
34         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
35     (r'^documents/', include(wiki.urls)),
36     url(r'^themes$', 'wiki.views.themes', name="themes"),
37     url(r'^$', 'django.views.generic.simple.redirect_to', {'url': '/documents/'}),
38
39 )