zip download and fabfile fixes
[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/', include('lesmianator.urls')),
21     url(r'^przypisy/', include('dictionary.urls')),
22     url(r'^statystyka/', include('stats.urls')),
23
24     # Static pages
25     url(r'^mozesz-nam-pomoc/$', 'infopages.views.infopage', {'slug': 'help_us'}, name='help_us'),
26     url(r'^o-projekcie/$', 'infopages.views.infopage', {'slug': 'about_us'}, name='about_us'),
27     url(r'^widget/$', 'infopages.views.infopage', {'slug': 'widget'}, name='widget'),
28
29     # Admin panel
30     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
31     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
32     url(r'^admin/', include(admin.site.urls)),
33
34     # Authentication
35     url(r'^uzytkownicy/zaloguj/$', 'catalogue.views.login', name='login'),
36     url(r'^uzytkownicy/wyloguj/$', 'catalogue.views.logout_then_redirect', name='logout'),
37     url(r'^uzytkownicy/utworz/$', 'catalogue.views.register', name='register'),
38     url(r'^uzytkownicy/login/$', 'django.contrib.auth.views.login', name='simple_login'),
39
40     # API
41     (r'^api/', include('api.urls')),
42
43     # Static files
44     url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
45         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
46     url(r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
47         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
48     url(r'^$', 'django.views.generic.simple.redirect_to', {'url': 'katalog/'}),
49     url(r'^i18n/', include('django.conf.urls.i18n')),
50 )
51
52 urlpatterns += patterns('django.views.generic.simple',
53     # old static pages - redirected
54     (r'^1procent/$', 'redirect_to', {'url': 'http://nowoczesnapolska.org.pl/wesprzyj_nas/'}),
55     (r'^wolontariat/$', 'redirect_to', {'url': '/mozesz-nam-pomoc/'}),
56     (r'^epub/$', 'redirect_to', {'url': '/katalog/lektury/'}),
57 )
58     
59
60 if 'rosetta' in settings.INSTALLED_APPS:
61     urlpatterns += patterns('',
62         url(r'^rosetta/', include('rosetta.urls')),
63     )