aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/urls.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2021-10-10 22:19:26 +0300
committerGravatar Hassan Abouelela <[email protected]>2021-10-10 23:06:46 +0300
commita7e9bdd9dbf086094dd138feb9464b7e7fe8b08b (patch)
treedddc532795211cae019b686d25edca7285828cc2 /pydis_site/urls.py
parentMerge pull request #609 from python-discord/static-previews (diff)
Adds Redirects To Static Builds
Dynamically adds static HTML redirects for static builds. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/urls.py')
-rw-r--r--pydis_site/urls.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/pydis_site/urls.py b/pydis_site/urls.py
index 51ef4214..6cd31f26 100644
--- a/pydis_site/urls.py
+++ b/pydis_site/urls.py
@@ -11,19 +11,25 @@ NON_STATIC_PATTERNS = [
# Internal API ingress (cluster local)
path('pydis-api/', include('pydis_site.apps.api.urls', namespace='internal_api')),
- # This must be mounted before the `content` app to prevent Django
- # from wildcard matching all requests to `pages/...`.
- path('', include('pydis_site.apps.redirect.urls')),
path('', include('django_prometheus.urls')),
-
- path('staff/', include('pydis_site.apps.staff.urls', namespace='staff')),
] if not settings.env("STATIC_BUILD") else []
urlpatterns = (
*NON_STATIC_PATTERNS,
+
+ # This must be mounted before the `content` app to prevent Django
+ # from wildcard matching all requests to `pages/...`.
+ path('', include('pydis_site.apps.redirect.urls')),
+
path('pages/', include('pydis_site.apps.content.urls', namespace='content')),
path('resources/', include('pydis_site.apps.resources.urls')),
path('events/', include('pydis_site.apps.events.urls', namespace='events')),
path('', include('pydis_site.apps.home.urls', namespace='home')),
)
+
+
+if not settings.env("STATIC_BUILD"):
+ urlpatterns += (
+ path('staff/', include('pydis_site.apps.staff.urls', namespace='staff')),
+ )