1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
from django.conf import settings
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.contrib.contenttypes import views as contenttypes_views
from django.contrib.flatpages.sitemaps import FlatPageSitemap
from django.contrib.sitemaps import views as sitemap_views
from django.urls import include, path, re_path
from django.views.decorators.cache import cache_page
from django.views.generic import RedirectView, TemplateView
from django.views.static import serve
from accounts import views as account_views
from aggregator.feeds import CommunityAggregatorFeed, CommunityAggregatorFirehoseFeed
from blog.feeds import WeblogEntryFeed
from blog.sitemaps import WeblogSitemap
from djangoproject.sitemaps import TemplateViewSitemap
from foundation.feeds import FoundationMinutesFeed
from foundation.views import BannerPreview, CoreDevelopers
admin.autodiscover()
sitemaps = {
"weblog": WeblogSitemap,
"flatpages": FlatPageSitemap,
"templates": TemplateViewSitemap,
}
urlpatterns = [
path("", TemplateView.as_view(template_name="homepage.html"), name="homepage"),
path(
"about/",
RedirectView.as_view(
pattern_name="members:developer-members",
permanent=True,
),
),
path(
"start/overview/",
TemplateView.as_view(template_name="overview.html"),
name="overview",
),
path("start/", TemplateView.as_view(template_name="start.html"), name="start"),
# to work around a permanent redirect stored in the db that existed
# before the redesign:
path("overview/", RedirectView.as_view(url="/start/overview/", permanent=False)),
path("accounts/", include("accounts.urls")),
# Admin password reset
path(
"admin/password_reset/",
auth_views.PasswordResetView.as_view(),
name="admin_password_reset",
),
path(
"admin/password_reset/done/",
auth_views.PasswordResetDoneView.as_view(),
name="password_reset_done",
),
path(
"reset/<uidb64>/<token>/",
auth_views.PasswordResetConfirmView.as_view(),
name="password_reset_confirm",
),
path(
"reset/done/",
auth_views.PasswordResetCompleteView.as_view(),
name="password_reset_complete",
),
path("admin/", admin.site.urls),
path("community/", include("aggregator.urls")),
path(
"conduct/",
TemplateView.as_view(template_name="conduct/index.html"),
name="code_of_conduct",
),
path(
"conduct/faq/",
TemplateView.as_view(template_name="conduct/faq.html"),
name="conduct_faq",
),
path(
"conduct/reporting/",
TemplateView.as_view(template_name="conduct/reporting.html"),
name="conduct_reporting",
),
path(
"conduct/enforcement-manual/",
TemplateView.as_view(template_name="conduct/enforcement.html"),
name="conduct_enforcement",
),
path(
"conduct/changes/",
TemplateView.as_view(template_name="conduct/changes.html"),
name="conduct_changes",
),
path(
"diversity/",
TemplateView.as_view(template_name="diversity/index.html"),
name="diversity",
),
path(
"diversity/changes/",
TemplateView.as_view(template_name="diversity/changes.html"),
name="diversity_changes",
),
path("checklists/", include("checklists.urls")),
path("contact/", include("contact.urls")),
path(
"foundation/banners/<int:pk>/preview/",
BannerPreview.as_view(),
name="foundation_banner_preview",
),
path("foundation/django_core/", CoreDevelopers.as_view()),
path("foundation/minutes/", include("foundation.urls.meetings")),
path("foundation/", include("members.urls")),
path("fundraising/", include("fundraising.urls")),
# Used by docs search suggestions
re_path(
r"^r/(?P<content_type_id>\d+)/(?P<object_id>.*)/$",
contenttypes_views.shortcut,
name="contenttypes-shortcut",
),
# User stats
path("~<username>/", account_views.user_profile, name="user_profile"),
# Feeds
path("rss/weblog/", WeblogEntryFeed(), name="weblog-feed"),
path("rss/community/", RedirectView.as_view(url="/rss/community/blogs/")),
path(
"rss/community/firehose/",
CommunityAggregatorFirehoseFeed(),
name="aggregator-firehose-feed",
),
path("rss/community/<slug>/", CommunityAggregatorFeed(), name="aggregator-feed"),
path(
"rss/foundation/minutes/",
FoundationMinutesFeed(),
name="foundation-minutes-feed",
),
# django-push
path("subscriber/", include("django_push.subscriber.urls")),
# Trac schtuff
path("trac/", include("tracdb.urls")),
# Styleguide
path(
"styleguide/",
TemplateView.as_view(template_name="styleguide.html"),
name="styleguide",
),
path(
"sitemap.xml",
cache_page(60 * 60 * 6)(sitemap_views.sitemap),
{"sitemaps": sitemaps},
name="sitemap",
),
path(
".well-known/security.txt",
TemplateView.as_view(
template_name="well-known/security.txt", content_type="text/plain"
),
),
path("weblog/", include("blog.urls")),
path("download/", include("releases.urls")),
path("svntogit/", include("svntogit.urls")),
path("", include("legacy.urls")),
path(
"foundation/individual-membership-nomination/",
RedirectView.as_view(
url="https://forms.gle/xKaZQqYswbMu2K5q6",
permanent=False,
),
),
]
if settings.DEBUG:
urlpatterns += [
path("m/<path:path>", serve, {"document_root": settings.MEDIA_ROOT}),
]
try:
import debug_toolbar
except ImportError:
pass
else:
urlpatterns += [
path("__debug__/", include(debug_toolbar.urls)),
]
|