arcology/arcology/urls.py

26 lines
985 B
Python

# [[file:../arcology.org::*The Web Server][The Web Server:1]]
from django.contrib import admin
from django.urls import path, re_path, include
from django.conf import settings
from arcology import views
urlpatterns = [
path("admin/", admin.site.urls),
path("", views.index),
path("robots.txt", views.robots, name="robots_txt"),
path("404", views.unpublished, name="page_not_found"),
path("sites.css", views.site_css, name="site-css"),
path("feeds.json", views.feed_list, name="feed-list"),
path("", include("django_prometheus.urls")),
path("", include("sitemap.urls")),
# ensure these ones are last because they're greedy!
re_path("(?P<key>[0-9a-zA-Z/_\-]+\.xml)", views.feed, name="feed"),
re_path("(?P<key>[0-9a-zA-Z/_\-\.]+)", views.org_page, name="org-page"),
]
if settings.ARCOLOGY_ENVIRONMENT != "production":
urlpatterns = [
path("api/v1/", include("localapi.urls")),
] + urlpatterns
# The Web Server:1 ends here