fix in api
[wolnelektury.git] / src / wolnelektury / urls.py
1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 #
5 from django.conf.urls import include, patterns, url
6 from django.conf import settings
7 from django.contrib import admin
8 from django.views.generic import RedirectView
9 import wolnelektury.views
10
11
12 urlpatterns = patterns(
13     'wolnelektury.views',
14     url(r'^$', 'main_page', name='main_page'),
15     url(r'^planowane/$', 'publish_plan', name='publish_plan'),
16     url(r'^widget\.html$', 'widget', name='widget'),
17
18     url(r'^zegar/$', 'clock', name='clock'),
19
20     # Authentication
21     url(r'^uzytkownik/$', 'user_settings', name='user_settings'),
22     url(r'^uzytkownik/login/$', wolnelektury.views.LoginFormView(), name='login'),
23     url(r'^uzytkownik/signup/$', wolnelektury.views.RegisterFormView(), name='register'),
24     url(r'^uzytkownik/logout/$', 'logout_then_redirect', name='logout'),
25     url(r'^uzytkownik/zaloguj-utworz/$', wolnelektury.views.LoginRegisterFormView(), name='login_register'),
26
27     # Includes.
28     url(r'^latests_blog_posts.html$',
29         wolnelektury.views.latest_blog_posts,
30         name='latest_blog_posts'),
31 )
32
33 urlpatterns += patterns(
34     '',
35     url(r'^katalog/', include('catalogue.urls')),
36     url(r'^opds/', include('opds.urls')),
37     url(r'^sugestia/', include('suggest.urls')),
38     url(r'^lesmianator/', include('lesmianator.urls')),
39     url(r'^przypisy/', include('dictionary.urls')),
40     url(r'^raporty/', include('reporting.urls')),
41     url(r'^info/', include('infopages.urls')),
42     url(r'^ludzie/', include('social.urls')),
43     url(r'^uzytkownik/', include('allauth.urls')),
44     url(r'^czekaj/', include('waiter.urls')),
45     url(r'^wesprzyj/', include('funding.urls')),
46     url(r'^ankieta/', include('polls.urls')),
47     url(r'^biblioteki/', include('libraries.urls')),
48     url(r'^chunks/', include('chunks.urls')),
49     url(r'^sponsors/', include('sponsors.urls')),
50
51     # Admin panel
52     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
53     url(r'^admin/catalogue/picture/import$', 'picture.views.import_picture', name='import_picture'),
54     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
55     url(r'^admin/', include(admin.site.urls)),
56
57     # API
58     (r'^api/', include('api.urls')),
59     # OAIPMH
60     (r'^oaipmh/', include('oai.urls')),
61
62     url(r'^szukaj/', include('search.urls')),
63
64     # Static files
65     url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
66         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
67     url(r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
68         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
69     url(r'^i18n/', include('django.conf.urls.i18n')),
70 )
71
72 urlpatterns += patterns(
73     '',
74     # old static pages - redirected
75     url(r'^1procent/$', RedirectView.as_view(
76         url='http://nowoczesnapolska.org.pl/wesprzyj_nas/', permanent=True)),
77     url(r'^epub/$', RedirectView.as_view(
78         url='/katalog/lektury/', permanent=False)),
79     url(r'^mozesz-nam-pomoc/$', RedirectView.as_view(
80         url='/info/wlacz-sie-w-prace/', permanent=True)),
81     url(r'^o-projekcie/$', RedirectView.as_view(
82         url='/info/o-projekcie/', permanent=True)),
83     url(r'^widget/$', RedirectView.as_view(
84         url='/info/widget/', permanent=True)),
85     url(r'^wolontariat/$', RedirectView.as_view(
86         url='/info/wlacz-sie-w-prace/', permanent=False)),
87 )