merge player changes and detail page + search
[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 import views
8
9
10 admin.autodiscover()
11
12 urlpatterns = patterns('wolnelektury.views',
13     url(r'^$', 'main_page', name='main_page'),
14     url(r'^planowane/$', 'publish_plan', name='publish_plan'),
15
16     url(r'^zegar/$', 'clock', name='clock'),
17
18     # Authentication
19     url(r'^uzytkownicy/zaloguj/$', views.LoginFormView(), name='login'),
20     url(r'^uzytkownicy/utworz/$', views.RegisterFormView(), name='register'),
21     url(r'^uzytkownicy/wyloguj/$', 'logout_then_redirect', name='logout'),
22 )
23
24 urlpatterns += patterns('',
25     url(r'^katalog/', include('catalogue.urls')),
26     url(r'^materialy/', include('lessons.urls')),
27     url(r'^opds/', include('opds.urls')),
28     url(r'^sugestia/', include('suggest.urls')),
29     url(r'^lesmianator/', include('lesmianator.urls')),
30     url(r'^przypisy/', include('dictionary.urls')),
31     url(r'^raporty/', include('reporting.urls')),
32     url(r'^info/', include('infopages.urls')),
33
34     # Admin panel
35     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
36     url(r'^admin/catalogue/picture/import$', 'picture.views.import_picture', name='import_picture'),
37     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
38     url(r'^admin/', include(admin.site.urls)),
39
40     # API
41     (r'^api/', include('api.urls')),
42
43     url(r'^fullsearch/', include('search.urls')),
44
45     # Static files
46     url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
47         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
48     url(r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
49         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
50     url(r'^i18n/', include('django.conf.urls.i18n')),
51 )
52
53 urlpatterns += patterns('django.views.generic.simple',
54     # old static pages - redirected
55     url(r'^1procent/$', 'redirect_to',
56         {'url': 'http://nowoczesnapolska.org.pl/wesprzyj_nas/'}),
57     url(r'^epub/$', 'redirect_to',
58         {'url': '/katalog/lektury/'}),
59     url(r'^mozesz-nam-pomoc/$', 'redirect_to',
60         {'url': '/info/mozesz-nam-pomoc'}),
61     url(r'^o-projekcie/$', 'redirect_to',
62         {'url': '/info/o-projekcie'}),
63     url(r'^widget/$', 'redirect_to',
64         {'url': '/info/widget'}),
65     url(r'^wolontariat/$', 'redirect_to',
66         {'url': '/info/mozesz-nam-pomoc/'}),
67 )
68     
69
70 if 'rosetta' in settings.INSTALLED_APPS:
71     urlpatterns += patterns('',
72         url(r'^rosetta/', include('rosetta.urls')),
73     )