Updated librarian.
[wolnelektury.git] / wolnelektury / urls.py
1 # -*- coding: utf-8 -*-
2 import os
3
4 from django.conf.urls.defaults import *
5 from django.conf import settings
6 from django.contrib import admin
7
8 from catalogue.forms import SearchForm
9
10 from infopages.models import InfoPage
11
12
13 admin.autodiscover()
14
15 infopages = {
16     'queryset': InfoPage.objects.all(),
17     'template_name': 'info/base.html',
18 }
19
20 urlpatterns = patterns('',
21     url(r'^katalog/', include('catalogue.urls')),
22     url(r'^materialy/', include('lessons.urls')),
23     url(r'^sugestia/', include('suggest.urls')),
24
25     # Static pages
26     url(r'^wolontariat/$', 'django.views.generic.list_detail.object_detail',
27         dict(infopages, slug='voluntary_services'), name='voluntary_services'),
28     url(r'^mozesz-nam-pomoc/$', 'django.views.generic.list_detail.object_detail',
29         dict(infopages, slug='help_us'), name='help_us'),
30     url(r'^o-projekcie/$', 'django.views.generic.list_detail.object_detail',
31         dict(infopages, slug='about_us'), name='about_us'),
32
33     url(r'^1procent/$', 'django.views.generic.simple.direct_to_template', {
34         'template': '1percent.html'
35     }, name='1percent'),
36
37     # Admin panel
38     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
39     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
40     url(r'^admin/(.*)$', admin.site.root),
41
42     # Authentication
43     url(r'^uzytkownicy/zaloguj/$', 'catalogue.views.login', name='login'),
44     url(r'^uzytkownicy/wyloguj/$', 'catalogue.views.logout_then_redirect', name='logout'),
45     url(r'^uzytkownicy/utworz/$', 'catalogue.views.register', name='register'),
46
47     # API
48     (r'^api/', include('api.urls')),
49
50     # Static files
51     url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
52         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
53     url(r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
54         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
55     url(r'^$', 'django.views.generic.simple.redirect_to', {'url': 'katalog/'}),
56     url(r'^i18n/', include('django.conf.urls.i18n')),
57 )
58
59 if 'rosetta' in settings.INSTALLED_APPS:
60     urlpatterns += patterns('',
61         url(r'^rosetta/', include('rosetta.urls')),
62     )