Use internal JSON.
[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 admin.autodiscover()
6 PATH_END = r"(?P<path>[^/]+)$"
7
8 urlpatterns = patterns('',
9     # Explorer:
10     url(r'^$', 'explorer.views.file_list', name='file_list'),
11     
12     url(r'^file/text/'+PATH_END, 'explorer.views.file_xml', name='file_xml'),
13     url(r'^file/dc/'+PATH_END, 'explorer.views.file_dc', name='file_dc'),
14     url(r'^file/upload', 'explorer.views.file_upload', name='file_upload'),
15     url(r'^file/commit/'+PATH_END, 'explorer.views.file_commit', name='file_commit'),
16     url(r'^file/update/'+PATH_END, 'explorer.views.file_update_local', name='file_update'),
17
18     url(r'^images/(?P<folder>[^/]+)/$', 'explorer.views.folder_images', name='folder_image'),
19     url(r'^images/$', 'explorer.views.folder_images', {'folder': '.'}, name='folder_image_ajax'),
20     
21     # Editor panels
22     url(r'^editor/panel/xmleditor/'+PATH_END, 'explorer.views.xmleditor_panel', name='xmleditor_panel'),
23     url(r'^editor/panel/gallery/'+PATH_END, 'explorer.views.gallery_panel', name='gallery_panel'),
24     url(r'^editor/panel/htmleditor/'+PATH_END, 'explorer.views.htmleditor_panel', name='htmleditor_panel'),
25     url(r'^editor/panel/dceditor/'+PATH_END, 'explorer.views.dceditor_panel', name='dceditor_panel'),
26     url(r'^editor/'+PATH_END, 'explorer.views.display_editor', name='editor_view'),
27
28     
29     # Task managment
30     url(r'^manager/pull-requests$', 'explorer.views.pull_requests'),
31
32     # Admin panel
33     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
34     url(r'^admin/(.*)', admin.site.root),
35
36     # Authorization
37     url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'redirect_field_name': 'next'}),
38     url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
39 )
40
41
42 # Static files
43 if settings.DEBUG and not hasattr(settings, 'DONT_SERVE_STATIC'):
44     urlpatterns += patterns('',
45         url(r'^%s(?P<path>.+)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
46             {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
47         url(r'^%s(?P<path>.+)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
48             {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
49     )