1d76ee80cb5c5e84f8fd502ea6011edd88b338a1
[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
8 admin.autodiscover()
9
10 urlpatterns = patterns('',
11     # Auth
12     url(r'^accounts/login/$', 'django.contrib.auth.views.login', name='login'),
13     url(r'^accounts/logout/$', 'catalogue.views.logout_then_redirect', name='logout'),
14
15     # Admin panel
16     (r'^admin/filebrowser/', include('filebrowser.urls')),
17     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
18     (r'^admin/', include(admin.site.urls)),
19
20     (r'^comments/', include('django.contrib.comments.urls')),
21
22     url(r'^$', 'django.views.generic.simple.redirect_to', {'url': '/documents/'}),
23     url(r'^documents/', include('catalogue.urls')),
24     url(r'^apiclient/', include('apiclient.urls')),
25     url(r'^editor/', include('wiki.urls')),
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'^$', 'django.views.generic.simple.redirect_to', {'url': '/documents/'}),
36
37 )