c3b14c87e14187c2c31a802c8112f89a8d01a563
[redakcja.git] / project / urls.py
1 from django.conf.urls.defaults import *
2 from django.contrib import admin
3 from django.conf import settings
4
5
6 admin.autodiscover()
7
8
9 urlpatterns = patterns('',
10     # Example:
11     url(r'^$', 'explorer.views.file_list', name='file_list'),
12     url(r'^file/(?P<path>[^/]+)/$', 'explorer.views.file_xml', name='file_xml'),
13     url(r'^html/(?P<path>[^/]+)/', 'explorer.views.file_html', name='file_html'),
14
15     # Admin panel
16     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
17     url(r'^admin/(.*)', admin.site.root),
18 )
19
20
21 # Static files
22 if settings.DEBUG:
23     urlpatterns += patterns('',
24         url(r'^%s(?P<path>.+)$' % settings.MEDIA_URL[1:], 'django.views.static.serve', 
25             {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
26         url(r'^%s(?P<path>.+)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
27             {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
28     )