aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/urls.py
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2022-01-23 16:38:03 +0100
committerGravatar Leon Sandøy <[email protected]>2022-01-23 16:38:03 +0100
commit605d9a0266a9a967f051fa244bf1c2d31776c119 (patch)
treea9f3218e355c8f6a106ba2604334ce8a34823715 /pydis_site/urls.py
parentLink icons belong close together. (diff)
parentMerge pull request #640 from Krish-bhardwaj/main (diff)
Merge branch 'main' into swfarnsworth/smarter-resources/merge-with-main
Diffstat (limited to 'pydis_site/urls.py')
-rw-r--r--pydis_site/urls.py30
1 files changed, 29 insertions, 1 deletions
diff --git a/pydis_site/urls.py b/pydis_site/urls.py
index 47cf0ba1..6cd31f26 100644
--- a/pydis_site/urls.py
+++ b/pydis_site/urls.py
@@ -1,7 +1,35 @@
+from django.contrib import admin
from django.urls import include, path
+from pydis_site import settings
+
+NON_STATIC_PATTERNS = [
+ path('admin/', admin.site.urls),
+
+ # External API ingress (over the net)
+ path('api/', include('pydis_site.apps.api.urls', namespace='api')),
+ # Internal API ingress (cluster local)
+ path('pydis-api/', include('pydis_site.apps.api.urls', namespace='internal_api')),
+
+ path('', include('django_prometheus.urls')),
+] 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')),
- path('staff/', include('pydis_site.apps.staff.urls', namespace='staff')),
)
+
+
+if not settings.env("STATIC_BUILD"):
+ urlpatterns += (
+ path('staff/', include('pydis_site.apps.staff.urls', namespace='staff')),
+ )