diff options
author | 2021-11-05 10:09:35 +0530 | |
---|---|---|
committer | 2021-11-05 10:09:35 +0530 | |
commit | 747a7b9cb465c85a064ac6e1a0444bcf8a81ec65 (patch) | |
tree | 1bb529b764bed5c727a3956b7bb432a18ec82d43 /pydis_site/urls.py | |
parent | Merge branch 'main' into otn_softdel (diff) | |
parent | Merge pull request #617 from python-discord/mbaruh-patch-1 (diff) |
Pull from upstream/main and resolve conflicts.
Diffstat (limited to 'pydis_site/urls.py')
-rw-r--r-- | pydis_site/urls.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/pydis_site/urls.py b/pydis_site/urls.py index 47cf0ba1..51ef4214 100644 --- a/pydis_site/urls.py +++ b/pydis_site/urls.py @@ -1,7 +1,29 @@ +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')), + + # 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, + 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')), ) |