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