Merge branch 'master' of https://github.com/fnp/wolnelektury
[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 wolnelektury_core.views
8
9
10 admin.autodiscover()
11
12 urlpatterns = patterns('wolnelektury_core.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'^uzytkownik/$', 'user_settings', name='user_settings'),
20     url(r'^uzytkownik/login/$', wolnelektury_core.views.LoginFormView(), name='login'),
21     url(r'^uzytkownik/signup/$', wolnelektury_core.views.RegisterFormView(), name='register'),
22     url(r'^uzytkownik/logout/$', 'logout_then_redirect', name='logout'),
23     url(r'^uzytkownik/zaloguj-utworz/$', wolnelektury_core.views.LoginRegisterFormView(), name='login_register'),
24 )
25
26 urlpatterns += patterns('',
27     url(r'^katalog/', include('catalogue.urls')),
28     #url(r'^materialy/', include('lessons.urls')),
29     url(r'^opds/', include('opds.urls')),
30     url(r'^sugestia/', include('suggest.urls')),
31     url(r'^lesmianator/', include('lesmianator.urls')),
32     url(r'^przypisy/', include('dictionary.urls')),
33     url(r'^raporty/', include('reporting.urls')),
34     url(r'^info/', include('infopages.urls')),
35     url(r'^ludzie/', include('social.urls')),
36     url(r'^uzytkownik/', include('allauth.urls')),
37     url(r'^czekaj/', include('waiter.urls')),
38
39     # Admin panel
40     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
41     url(r'^admin/catalogue/picture/import$', 'picture.views.import_picture', name='import_picture'),
42     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
43     url(r'^admin/', include(admin.site.urls)),
44
45     # API
46     (r'^api/', include('api.urls')),
47
48     url(r'^szukaj/', include('search.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'^i18n/', include('django.conf.urls.i18n')),
56 )
57
58 urlpatterns += patterns('django.views.generic.simple',
59     # old static pages - redirected
60     url(r'^1procent/$', 'redirect_to',
61         {'url': 'http://nowoczesnapolska.org.pl/wesprzyj_nas/'}),
62     url(r'^epub/$', 'redirect_to',
63         {'url': '/katalog/lektury/'}),
64     url(r'^mozesz-nam-pomoc/$', 'redirect_to',
65         {'url': '/info/mozesz-nam-pomoc'}),
66     url(r'^o-projekcie/$', 'redirect_to',
67         {'url': '/info/o-projekcie'}),
68     url(r'^widget/$', 'redirect_to',
69         {'url': '/info/widget'}),
70     url(r'^wolontariat/$', 'redirect_to',
71         {'url': '/info/mozesz-nam-pomoc/'}),
72 )
73     
74
75 if 'rosetta' in settings.INSTALLED_APPS:
76     urlpatterns += patterns('',
77         url(r'^rosetta/', include('rosetta.urls')),
78     )