librarian fix
[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 urlpatterns = patterns('',
16     url(r'^katalog/', include('catalogue.urls')),
17     url(r'^materialy/', include('lessons.urls')),
18     url(r'^opds/', include('opds.urls')),
19     url(r'^sugestia/', include('suggest.urls')),
20     url(r'^lesmianator/?$', 'lesmianator.views.poem', name='lesmianator'),
21
22     # Static pages
23     url(r'^wolontariat/$', 'infopages.views.infopage', {'slug': 'voluntary_services'}, name='voluntary_services'),
24     url(r'^mozesz-nam-pomoc/$', 'infopages.views.infopage', {'slug': 'help_us'}, name='help_us'),
25     url(r'^o-projekcie/$', 'infopages.views.infopage', {'slug': 'about_us'}, name='about_us'),
26     url(r'^widget/$', 'infopages.views.infopage', {'slug': 'widget'}, name='widget'),
27     url(r'^epub/$', 'infopages.views.infopage', {'slug': 'epub'}, name='epub'),
28     
29     url(r'^1procent/$', 'django.views.generic.simple.direct_to_template', {
30         'template': '1percent.html'
31     }, name='1percent'),
32
33     # Admin panel
34     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
35     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
36     url(r'^admin/', include(admin.site.urls)),
37
38     # Authentication
39     url(r'^uzytkownicy/zaloguj/$', 'catalogue.views.login', name='login'),
40     url(r'^uzytkownicy/wyloguj/$', 'catalogue.views.logout_then_redirect', name='logout'),
41     url(r'^uzytkownicy/utworz/$', 'catalogue.views.register', name='register'),
42
43     # API
44     (r'^api/', include('api.urls')),
45
46     # Static files
47     url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
48         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
49     url(r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
50         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
51     url(r'^$', 'django.views.generic.simple.redirect_to', {'url': 'katalog/'}),
52     url(r'^i18n/', include('django.conf.urls.i18n')),
53 )
54
55 if 'rosetta' in settings.INSTALLED_APPS:
56     urlpatterns += patterns('',
57         url(r'^rosetta/', include('rosetta.urls')),
58     )