Prepare for 1.3.6 release.
[mailman-postorious.git] / example_project / urls.py
bloba63d14c5c906d2c4b7524f5736d6ba0825c5b471
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 1998-2021 by the Free Software Foundation, Inc.
4 # This file is part of Postorius.
6 # Postorius is free software: you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation, either version 3 of the License, or (at your option)
9 # any later version.
11 # Postorius is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 # more details.
16 # You should have received a copy of the GNU General Public License along with
17 # Postorius. If not, see <http://www.gnu.org/licenses/>.
20 from django.urls import include, re_path
21 from django.contrib import admin
22 from django.http import Http404
23 from django.urls import reverse_lazy
24 from django.views.defaults import server_error
25 from django.views.generic import RedirectView
28 def not_found(request):
29 """A test view to return 404 error to test 400.html"""
30 raise Http404('Page not Found.')
33 urlpatterns = [
34 re_path(r'^$', RedirectView.as_view(
35 url=reverse_lazy('list_index'),
36 permanent=True)),
37 re_path(r'^postorius/', include('postorius.urls')),
38 re_path(r'', include('django_mailman3.urls')),
39 re_path(r'^accounts/', include('allauth.urls')),
40 # Add some testing routes to test 400/500 error pages without having to
41 # introduce errors.
42 re_path(r'500/$', server_error),
43 re_path(r'400/$', not_found),
44 # Django admin
45 re_path(r'^admin/', admin.site.urls),