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:
@@ -117,11 +117,24 @@ cd /pfad/zu/ArgumentAtlas
|
|||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
set -a && source /etc/faktenkompass.env && set +a
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
python manage.py collectstatic --noinput
|
python manage.py collectstatic --noinput
|
||||||
python manage.py createsuperuser # falls noch nicht vorhanden
|
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.
|
Stellen Sie sicher, dass der Prozessnutzer Schreibrechte für `media/` und die Datenbank hat.
|
||||||
|
|
||||||
### 3. Daphne manuell testen
|
### 3. Daphne manuell testen
|
||||||
|
|||||||
Reference in New Issue
Block a user