7ba920943d3394780ac05dc85639f89ed5d12e83
[prawokultury.git] / prawokultury / urls.py
1 # -*- coding: utf-8 -*-
2 # This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 #
5 from django.conf import settings
6 from django.conf.urls import patterns, include, url
7 from django.contrib import admin
8 from django.contrib.staticfiles.urls import staticfiles_urlpatterns
9 from migdal.helpers import i18n_patterns
10 from migdal.urls import urlpatterns as migdal_urlpatterns
11 from django.utils.translation import ugettext_lazy as _, string_concat
12 from events.urls import urlpatterns as events_urlpatterns
13
14 admin.autodiscover()
15
16 urlpatterns = patterns('',
17     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
18     url(r'^admin/', include(admin.site.urls)),
19     url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
20             'document_root': settings.MEDIA_ROOT,
21         }),
22
23     (r'^accounts/login/$', 'django_cas.views.login'),
24     (r'^accounts/logout/$', 'django_cas.views.logout'),
25 ) + i18n_patterns('',
26     url(string_concat(r'^', _('events'), r'/'), include('events.urls')),
27     url(r'^comments/', include('django_comments_xtd.urls')),
28     url(r'^contact/', include('contact.urls')),
29 ) + migdal_urlpatterns 
30
31 if settings.DEBUG:
32     urlpatterns += patterns('',
33         url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
34             'document_root': settings.MEDIA_ROOT,
35         }),
36    )
37
38 urlpatterns += staticfiles_urlpatterns()