diff --git a/pems/districts/urls.py b/pems/districts/urls.py index a56d963..979bf94 100644 --- a/pems/districts/urls.py +++ b/pems/districts/urls.py @@ -2,7 +2,7 @@ URLConf for the districts app. """ -from django.urls import path +from django.urls import path, re_path from pems.districts import views @@ -10,5 +10,5 @@ urlpatterns = [ # /districts path("", views.IndexView.as_view(), name="index"), - path("", views.DistrictView.as_view(), name="district"), + re_path(r"^(?P([1-9]|1[0-2]))$", views.DistrictView.as_view(), name="district"), ] diff --git a/pems/settings.py b/pems/settings.py index 329d965..4d776a4 100644 --- a/pems/settings.py +++ b/pems/settings.py @@ -52,7 +52,7 @@ def _filter_empty(ls): TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [], + "DIRS": [os.path.join(BASE_DIR, "pems", "templates")], "APP_DIRS": True, "OPTIONS": { "context_processors": [ diff --git a/pems/templates/404.html b/pems/templates/404.html new file mode 100644 index 0000000..c0944fd --- /dev/null +++ b/pems/templates/404.html @@ -0,0 +1,7 @@ +{% extends "core/base.html" %} +{% block headline %} + Sorry! We can’t find that page. +{% endblock headline %} +{% block inner-content %} +

The page you are looking for might be somewhere else or may not exist anymore.

+{% endblock inner-content %}