734ca7cde61ef1a8b1b91896edf8c7367a3b19a5
[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 django.utils.translation import ugettext_lazy as _, string_concat
10 from fnpdjango.utils.urls import i18n_patterns
11 from migdal.urls import urlpatterns as migdal_urlpatterns
12
13 admin.autodiscover()
14
15 urlpatterns = patterns('',
16     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
17     url(r'^admin/', include(admin.site.urls)),
18     url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
19             'document_root': settings.MEDIA_ROOT,
20         }),
21
22     (r'^accounts/login/$', 'django_cas.views.login'),
23     (r'^accounts/logout/$', 'django_cas.views.logout'),
24 ) + i18n_patterns(
25     url(r'^comments/', include('django_comments_xtd.urls')),
26     url(r'^contact/', include('contact.urls')),
27 ) + migdal_urlpatterns 
28
29 if settings.DEBUG:
30     urlpatterns += patterns('',
31         url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
32             'document_root': settings.MEDIA_ROOT,
33         }),
34    )
35
36 urlpatterns += staticfiles_urlpatterns()