2a3f6c6a801d6d3519f471eaa763cd3d0e9745a8
[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, url
6 from django.conf import settings
7 from django.contrib import admin
8 from django.views.generic import RedirectView
9 import django.views.static
10 import catalogue.views
11 import picture.views
12 from . import views
13
14
15 urlpatterns = [
16     url(r'^$', views.main_page, name='main_page'),
17     url(r'^planowane/$', views.publish_plan, name='publish_plan'),
18     url(r'^widget\.html$', views.widget, name='widget'),
19
20     url(r'^zegar/$', views.clock, name='clock'),
21
22     # Authentication
23     url(r'^uzytkownik/$', views.user_settings, name='user_settings'),
24     url(r'^uzytkownik/login/$', views.LoginFormView(), name='login'),
25     url(r'^uzytkownik/signup/$', views.RegisterFormView(), name='register'),
26     url(r'^uzytkownik/logout/$', views.logout_then_redirect, name='logout'),
27     url(r'^uzytkownik/zaloguj-utworz/$', views.LoginRegisterFormView(), name='login_register'),
28
29     # Includes.
30     url(r'^latests_blog_posts.html$', views.latest_blog_posts, name='latest_blog_posts'),
31 ]
32
33 urlpatterns += [
34     url(r'^katalog/', include('catalogue.urls')),
35     url(r'^opds/', include('opds.urls')),
36     url(r'^sugestia/', include('suggest.urls')),
37     url(r'^lesmianator/', include('lesmianator.urls')),
38     url(r'^przypisy/', include('dictionary.urls')),
39     url(r'^raporty/', include('reporting.urls')),
40     url(r'^info/', include('infopages.urls')),
41     url(r'^ludzie/', include('social.urls')),
42     url(r'^uzytkownik/', include('allauth.urls')),
43     url(r'^czekaj/', include('waiter.urls')),
44     url(r'^wesprzyj/', include('funding.urls')),
45     url(r'^ankieta/', include('polls.urls')),
46     url(r'^biblioteki/', include('libraries.urls')),
47     url(r'^chunks/', include('chunks.urls')),
48     url(r'^sponsors/', include('sponsors.urls')),
49     url(r'^newsletter/', include('newsletter.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     url(r'^api/', include('api.urls')),
59     # OAIPMH
60     url(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 += [
73     # old static pages - redirected
74     url(r'^1procent/$', RedirectView.as_view(
75         url='http://nowoczesnapolska.org.pl/wesprzyj_nas/', permanent=True)),
76     url(r'^epub/$', RedirectView.as_view(
77         url='/katalog/lektury/', permanent=False)),
78     url(r'^mozesz-nam-pomoc/$', RedirectView.as_view(
79         url='/info/wlacz-sie-w-prace/', permanent=True)),
80     url(r'^o-projekcie/$', RedirectView.as_view(
81         url='/info/o-projekcie/', permanent=True)),
82     url(r'^widget/$', RedirectView.as_view(
83         url='/info/widget/', permanent=True)),
84     url(r'^wolontariat/$', RedirectView.as_view(
85         url='/info/wlacz-sie-w-prace/', permanent=False)),
86 ]
87
88 urlpatterns += [
89     url(r'^error-test/$', views.exception_test),
90 ]