From a0a0cfab8a8c6956be0aa1d96bcce27c864bfeb9 Mon Sep 17 00:00:00 2001 From: Wouter Vermeer Date: Wed, 29 Apr 2026 13:35:52 +0200 Subject: [PATCH] changes? --- docs/architecture/decisions.md | 5 ++--- src/website/settings.py | 8 +++++--- src/website/urls.py | 8 ++++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/architecture/decisions.md b/docs/architecture/decisions.md index 9f5cf38..8b66aad 100644 --- a/docs/architecture/decisions.md +++ b/docs/architecture/decisions.md @@ -100,13 +100,11 @@ Use Docker with Docker Compose for local development and production deployment, ### Reasoning - Docker ensures the application runs identically regardless of the host machine, reducing "works on my machine" issues during handoff. - Docker is an easier way of getting the full stack operational on a new contributors machine compared to making them do multiple different installs. -- Docker Compose is simple enough for a non-specialist maintainer to understand and operate. - Separate override files (`compose.dev.yaml`, `compose.prod.yaml`, `compose.test.yaml`) allow environment-specific configuration without duplicating the base service definitions. - A VPS with Docker is significantly cheaper than a managed hosting service while providing more control. ### Consequences -- New maintainers need minimal Docker literacy, but this is a reasonable baseline expectation. -- The Makefile wraps common Docker Compose commands to reduce the surface area a maintainer needs to know day-to-day. +- The Makefile wraps common Docker Compose commands to reduce increase ease-of-use. - Data persistence is handled via named Docker volumes. --- @@ -149,6 +147,7 @@ Use PEP8 as the style guide with enforced type hinting. Enforced using 'ruff' an ### Consequences Linting checks have to integrated into the CI/CD pipeline. 'Contributing.md' needs to be created to make it clear how to contribute. +Linting tools will have to installed. --- diff --git a/src/website/settings.py b/src/website/settings.py index d580774..839941d 100644 --- a/src/website/settings.py +++ b/src/website/settings.py @@ -41,8 +41,6 @@ INSTALLED_APPS = [ "django.contrib.messages", "django.contrib.staticfiles", "django.contrib.admindocs", - "django_browser_reload", - "django_watchfiles", ] MIDDLEWARE = [ @@ -53,9 +51,13 @@ MIDDLEWARE = [ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", - "django_browser_reload.middleware.BrowserReloadMiddleware", ] +if os.getenv("DJANGO_RELOAD", "False") == "True": + INSTALLED_APPS.append("django_browser_reload") + INSTALLED_APPS.append("django_watchfiles") + MIDDLEWARE.append("django_browser_reload.middleware.BrowserReloadMiddleware") + ROOT_URLCONF = "website.urls" TEMPLATES = [ diff --git a/src/website/urls.py b/src/website/urls.py index a4bd257..5115ec3 100644 --- a/src/website/urls.py +++ b/src/website/urls.py @@ -15,12 +15,16 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ +import os + from django.contrib import admin -from django.urls import path, include +from django.urls import include, path urlpatterns = [ path("polls/", include("polls.urls")), path("admin/doc/", include("django.contrib.admindocs.urls")), path("admin/", admin.site.urls), - path("__reload__/", include("django_browser_reload.urls")), ] + +if os.getenv("DJANGO_RELOAD", "False") == "True": + urlpatterns.append(path("__reload__/", include("django_browser_reload.urls")))