javascript translations
[redakcja.git] / redakcja / urls.py
1 # -*- coding: utf-8 -*-
2
3 from django.conf.urls import include, patterns, url
4 from django.contrib import admin
5 from django.conf import settings
6 from django.conf.urls.static import static
7 from django.contrib.staticfiles.urls import staticfiles_urlpatterns
8 import forms_builder.forms.urls
9
10
11 admin.autodiscover()
12
13 urlpatterns = patterns(
14     '',
15     # Auth
16     # url(r'^accounts/login/$', 'django_cas.views.login', name='login'),
17     # url(r'^accounts/logout/$', 'django_cas.views.logout', name='logout'),
18     # url(r'^accounts/login/$', 'django.contrib.auth.views.login', name='login'),
19     # url(r'^accounts/logout/$', 'django.contrib.auth.views.login', name='logout'),
20     # url(r'^admin/login/$', 'django_cas.views.login', name='login'),
21     # url(r'^admin/logout/$', 'django_cas.views.logout', name='logout'),
22     url('^accounts/', include('django.contrib.auth.urls')),
23
24     # Admin panel
25     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
26     (r'^admin/', include(admin.site.urls)),
27
28     url(r'^$', 'redakcja.views.main'),
29     url(r'^register$', 'redakcja.views.register', name='register'),
30     url(r'^documents/', include('catalogue.urls')),
31     url(r'^editor/', include('wiki.urls')),
32     url(r'^organizations/', include('organizations.urls')),
33     url(r'^forms/', include(forms_builder.forms.urls)),
34
35     url(r'^i18n/', include('django.conf.urls.i18n')),
36     (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', dict(packages=['wiki'])),
37
38 )
39
40 if settings.DEBUG:
41     urlpatterns += staticfiles_urlpatterns()
42     urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
43
44 if getattr(settings, 'SERVE_FILES_WITH_DEBUG_FALSE', False):
45     urlpatterns += patterns(
46         '',
47         (r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:],
48          'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
49         (r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:],
50          'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
51     )