Document collectstatic requirements for hashed static files in production.

Clarifies that collectstatic must run with production env vars and --clear after static updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Pirmin Hinderling (fedora)
2026-07-07 21:54:52 +02:00
parent fce11689e1
commit 3a5849660a
+13
View File
@@ -117,11 +117,24 @@ cd /pfad/zu/ArgumentAtlas
source .venv/bin/activate
pip install -r requirements.txt
set -a && source /etc/faktenkompass.env && set +a
python manage.py migrate
python manage.py collectstatic --noinput
python manage.py createsuperuser # falls noch nicht vorhanden
```
**Wichtig:** `collectstatic` immer mit denselben Umgebungsvariablen ausführen wie der Daphne-Dienst (`DJANGO_DEBUG=False`). Sonst fehlen gehashte Dateinamen bzw. `staticfiles.json` und die Seite antwortet mit 500.
Nach jedem `git pull` mit geänderten Static-Dateien:
```bash
set -a && source /etc/faktenkompass.env && set +a
python manage.py collectstatic --clear --noinput
sudo systemctl restart faktenkompass
```
Erfolg prüfen: `staticfiles/staticfiles.json` existiert, CSS heißt z.B. `custom.<hash>.css`.
Stellen Sie sicher, dass der Prozessnutzer Schreibrechte für `media/` und die Datenbank hat.
### 3. Daphne manuell testen