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