7a90ed1f9140a8a29a80fcd56a379906dfe0a711
[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     url(r'^images/(?P<folder>[^/]+)/$', 'explorer.views.folder_images', name='folder_image'),
15     url(r'^images/$', 'explorer.views.folder_images', {'folder': '.'}, name='folder_image_ajax'),
16     
17     # Editor panels
18     url(r'^editor/(?P<path>[^/]+)/panels/xmleditor$', 'explorer.views.xmleditor_panel', name='xmleditor_panel'),
19     url(r'^editor/(?P<path>[^/]+)/panels/gallery$', 'explorer.views.gallery_panel', name='gallery_panel'),
20     
21     # Admin panel
22     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
23     url(r'^admin/(.*)', admin.site.root),
24 )
25
26
27 # Static files
28 if settings.DEBUG:
29     urlpatterns += patterns('',
30         url(r'^%s(?P<path>.+)$' % settings.MEDIA_URL[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     )