1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from django.conf import settings
5 from django.contrib import admin
6 from django.urls import include, path
7 from django.views.generic import RedirectView
8 import django.views.static
9 from annoy.utils import banner_exempt
10 import catalogue.views
17 path('', views.main_page, name='main_page'),
18 path('planowane/', views.publish_plan, name='publish_plan'),
19 path('widget.html', views.widget, name='widget'),
21 path('zegar/', views.clock, name='clock'),
24 path('uzytkownik/', views.user_settings, name='user_settings'),
25 path('uzytkownik/login/', banner_exempt(views.LoginFormView()), name='login'),
26 path('uzytkownik/signup/', banner_exempt(views.RegisterFormView()), name='register'),
27 path('uzytkownik/logout/', views.logout_then_redirect, name='logout'),
28 path('uzytkownik/zaloguj-utworz/', banner_exempt(views.LoginRegisterFormView()), name='login_register'),
29 path('uzytkownik/social/signup/', banner_exempt(views.SocialSignupView.as_view()), name='socialaccount_signup'),
33 path('eksperymenty/', include('experiments.urls')),
34 path('katalog/', include('catalogue.urls')),
35 path('opds/', include('opds.urls')),
36 path('sugestia/', include('suggest.urls')),
37 path('lesmianator/', include('lesmianator.urls')),
38 path('przypisy/', include('dictionary.urls')),
39 path('raporty/', include('reporting.urls')),
40 path('info/', include('infopages.urls')),
41 path('ludzie/', include('social.urls')),
42 path('uzytkownik/', include('allauth.urls')),
43 path('czekaj/', include('waiter.urls')),
44 path('wesprzyj/', include('funding.urls')),
45 path('ankieta/', include('polls.urls')),
46 path('biblioteki/', include('libraries.urls')),
47 path('pinezki/', include('references.urls')),
48 path('newsletter/', include('newsletter.urls')),
49 path('formularz/', include('forms_builder.forms.urls')),
50 path('isbn/', include('isbn.urls')),
51 path('messaging/', include('messaging.urls')),
52 path('re/', include('redirects.urls')),
53 path('stats/', include('stats.urls')),
54 path('paypal/', include('paypal.urls')),
55 path('powiadomienie/', include('push.urls')),
56 path('pomagam/', include('club.urls')),
57 path('szkola-', include('education.urls')),
58 path('towarzystwo/notify/<int:pk>/', club.views.PayUNotifyView.as_view(), name='club_payu_notify'),
59 path('towarzystwo/', RedirectView.as_view(url='/pomagam/', permanent=False, query_string=True)),
60 path('towarzystwo/<path:path>', RedirectView.as_view(
61 url='/pomagam/%(path)s', permanent=False)),
63 path('chunks/', include('chunks.urls')),
66 path('admin/catalogue/book/import', catalogue.views.import_book, name='import_book'),
67 path('admin/catalogue/picture/import', picture.views.import_picture, name='import_picture'),
68 path('admin/doc/', include('django.contrib.admindocs.urls')),
69 path('admin/', admin.site.urls),
72 path('api/', include('api.urls')),
74 path('oaipmh/', include('oai.urls')),
76 path('szukaj/', include('search.urls')),
78 path('i18n/', include('django.conf.urls.i18n')),
82 # old static pages - redirected
83 path('1procent/', RedirectView.as_view(
84 url='https://fundacja.wolnelektury.pl/pomoz-nam/1-procent/', permanent=True)),
85 path('epub/', RedirectView.as_view(
86 url='/katalog/lektury/', permanent=False)),
87 path('mozesz-nam-pomoc/', RedirectView.as_view(
88 url='/info/wlacz-sie-w-prace/', permanent=True)),
89 path('o-projekcie/', RedirectView.as_view(
90 url='/info/o-projekcie/', permanent=True)),
91 path('widget/', RedirectView.as_view(
92 url='/info/widget/', permanent=True)),
93 path('wolontariat/', RedirectView.as_view(
94 url='/info/wlacz-sie-w-prace/', permanent=False)),
98 # path('error-test/', views.exception_test),
99 # path('post-test/', views.post_test),
106 path('__debug__/', include(debug_toolbar.urls)),
111 from django.views.defaults import page_not_found, server_error
113 path('error/500/', server_error),
114 path('error/404/', functools.partial(page_not_found, exception=None)),
117 path('%s<path:path>' % settings.MEDIA_URL[1:], django.views.static.serve,
118 {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),