aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/urls.py
blob: 799e86000e5227f5ce24b13679b33a4a9648fa0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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.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('timeline/', include('pydis_site.apps.timeline.urls', namespace='timeline')),
    path('', include('pydis_site.apps.home.urls', namespace='home')),
)


if not settings.STATIC_BUILD:
    urlpatterns += (
        path('staff/', include('pydis_site.apps.staff.urls', namespace='staff')),
    )