django-extensions
[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('wolnelektury.views',
13     url(r'^$', 'main_page', name='main_page'),
14     url(r'^planowane/$', 'publish_plan', name='publish_plan'),
15     url(r'^widget\.html$', 'widget', name='widget'),
16
17     url(r'^zegar/$', 'clock', name='clock'),
18
19     # Authentication
20     url(r'^uzytkownik/$', 'user_settings', name='user_settings'),
21     url(r'^uzytkownik/login/$', wolnelektury.views.LoginFormView(), name='login'),
22     url(r'^uzytkownik/signup/$', wolnelektury.views.RegisterFormView(), name='register'),
23     url(r'^uzytkownik/logout/$', 'logout_then_redirect', name='logout'),
24     url(r'^uzytkownik/zaloguj-utworz/$', wolnelektury.views.LoginRegisterFormView(), name='login_register'),
25
26     # Includes.
27     url(r'^latests_blog_posts.html$',
28         wolnelektury.views.latest_blog_posts,
29         name='latest_blog_posts'),
30 )
31
32 urlpatterns += patterns('',
33     url(r'^katalog/', include('catalogue.urls')),
34     url(r'^opds/', include('opds.urls')),
35     url(r'^sugestia/', include('suggest.urls')),
36     url(r'^lesmianator/', include('lesmianator.urls')),
37     url(r'^przypisy/', include('dictionary.urls')),
38     url(r'^raporty/', include('reporting.urls')),
39     url(r'^info/', include('infopages.urls')),
40     url(r'^ludzie/', include('social.urls')),
41     url(r'^uzytkownik/', include('allauth.urls')),
42     url(r'^czekaj/', include('waiter.urls')),
43     url(r'^wesprzyj/', include('funding.urls')),
44     url(r'^ankieta/', include('polls.urls')),
45     url(r'^biblioteki/', include('libraries.urls')),
46     url(r'^chunks/', include('chunks.urls')),
47     url(r'^sponsors/', include('sponsors.urls')),
48
49     # Admin panel
50     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
51     url(r'^admin/catalogue/picture/import$', 'picture.views.import_picture', name='import_picture'),
52     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
53     url(r'^admin/', include(admin.site.urls)),
54
55     # API
56     (r'^api/', include('api.urls')),
57     # OAIPMH
58     (r'^oaipmh/', include('oai.urls')),
59
60     url(r'^szukaj/', include('search.urls')),
61
62     # Static files
63     url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
64         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
65     url(r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
66         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
67     url(r'^i18n/', include('django.conf.urls.i18n')),
68 )
69
70 urlpatterns += patterns('',
71     # old static pages - redirected
72     url(r'^1procent/$', RedirectView.as_view(
73         url='http://nowoczesnapolska.org.pl/wesprzyj_nas/', permanent=True)),
74     url(r'^epub/$', RedirectView.as_view(
75         url='/katalog/lektury/', permanent=False)),
76     url(r'^mozesz-nam-pomoc/$', RedirectView.as_view(
77         url='/info/mozesz-nam-pomoc', permanent=True)),
78     url(r'^o-projekcie/$', RedirectView.as_view(
79         url='/info/o-projekcie', permanent=True)),
80     url(r'^widget/$', RedirectView.as_view(
81         url='/info/widget', permanent=True)),
82     url(r'^wolontariat/$', RedirectView.as_view(
83         url='/info/mozesz-nam-pomoc/', permanent=False)),
84 )