aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/urls.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2021-06-08 00:26:40 +0200
committerGravatar Johannes Christ <[email protected]>2021-06-08 00:29:59 +0200
commitc998d475440cf4819bad7ebc3ed19f31ce82baf4 (patch)
treebfdeba9a483ebb7646171c79f5b259c27f3d17dd /pydis_site/urls.py
parentFix `content` app tests not running on macOS (#519) (diff)
Move subdomains to query paths.
In more detail: - Use Django URL namespaces (e.g. `api:bot:infractions`) instead of `django_hosts` host argument. - Update the hosts file setup documentation to remove subdomain entries. - Update the hosts file setup documentation to mention that the entry of `pythondiscord.local` is not required and mainly for convenience. - Rename the `APISubdomainTestCase` to the more fitting `AuthenticatedAPITestCase`, as authentication is all that is left that the class is doing. - Drop dependency to `django_hosts`.
Diffstat (limited to 'pydis_site/urls.py')
-rw-r--r--pydis_site/urls.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/pydis_site/urls.py b/pydis_site/urls.py
index 47cf0ba1..3c9fe347 100644
--- a/pydis_site/urls.py
+++ b/pydis_site/urls.py
@@ -1,7 +1,21 @@
+from django.contrib import admin
from django.urls import include, path
urlpatterns = (
- path('', include('pydis_site.apps.home.urls', namespace='home')),
+ 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('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('staff/', include('pydis_site.apps.staff.urls', namespace='staff')),
+ path('', include('pydis_site.apps.home.urls', namespace='home')),
)