From 471ceb7da279ba0dc42c3fb224c6568e0fa686b9 Mon Sep 17 00:00:00 2001 From: Anton Karpov Date: Fri, 28 Aug 2026 02:21:09 +0300 Subject: [PATCH 1/2] Add STATIC_ROOT and MEDIA_ROOT to .env.example settings.py reads both through `config()` with no default, in the branch that runs when DEBUG is on, and the example sets DEBUG=True. So copying the file as its own first line instructs raises UndefinedValueError on `manage.py` before anything else happens. Of the 19 variables settings.py requires without a default, these were the only two the example did not declare. --- .env.example | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.env.example b/.env.example index 89ce71a2..634ca2b0 100644 --- a/.env.example +++ b/.env.example @@ -21,6 +21,11 @@ SECRET_KEY= DEBUG=True ALLOWED_HOSTS=.localhost,127.0.0.1 +# Read when DEBUG is on, i.e. when static and media are served locally +# rather than from Spaces. +STATIC_ROOT=staticfiles +MEDIA_ROOT=media + # ── DigitalOcean Spaces (static + media storage) ────────────────────────────── DO_ACCESS_KEY_ID= DO_SECRET_ACCESS_KEY= From 33c1bb384023fa1bba67ed24de8c933234cba32f Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Thu, 3 Sep 2026 09:36:52 -0400 Subject: [PATCH 2/2] Add staticfiles/ and media/ to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 435fe006..2720660a 100644 --- a/.gitignore +++ b/.gitignore @@ -82,6 +82,10 @@ celerybeat-schedule # dotenv .env +# Local static/media (STATIC_ROOT/MEDIA_ROOT) +staticfiles/ +media/ + # virtualenv .venv venv/