diff options
author | 2021-10-10 01:30:06 +0300 | |
---|---|---|
committer | 2021-10-10 01:30:06 +0300 | |
commit | 247c4ba220f9ee73767f4aac2737e520e7ec4b07 (patch) | |
tree | 8e3f7ca2ae7c3c8382007adf0d43d8456e7447b7 /pydis_site/urls.py | |
parent | Adds Django Distill To Project (diff) |
Adds Static Route Configurations
Adds configuration which specifies how routes should be handled when
building a static preview.
Diffstat (limited to 'pydis_site/urls.py')
-rw-r--r-- | pydis_site/urls.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pydis_site/urls.py b/pydis_site/urls.py index 891dbdcc..51ef4214 100644 --- a/pydis_site/urls.py +++ b/pydis_site/urls.py @@ -1,8 +1,9 @@ from django.contrib import admin from django.urls import include, path +from pydis_site import settings -urlpatterns = ( +NON_STATIC_PATTERNS = [ path('admin/', admin.site.urls), # External API ingress (over the net) @@ -14,9 +15,15 @@ urlpatterns = ( # 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('staff/', include('pydis_site.apps.staff.urls', namespace='staff')), path('', include('pydis_site.apps.home.urls', namespace='home')), ) |