fix: persist preview admin access
This commit is contained in:
@@ -118,6 +118,25 @@ python manage.py ensure_superuser
|
||||
python manage.py runserver
|
||||
```
|
||||
|
||||
### Persistent local preview without Docker
|
||||
|
||||
The local preview uses `instance/preview.sqlite3`, which survives server restarts and is
|
||||
ignored by Git. Put the preview admin credentials in `instance/preview_admin.env`
|
||||
(also ignored by Git):
|
||||
|
||||
```text
|
||||
DJANGO_SUPERUSER_USERNAME=admin
|
||||
DJANGO_SUPERUSER_EMAIL=admin@localhost
|
||||
DJANGO_SUPERUSER_PASSWORD=your-local-password
|
||||
DJANGO_SUPERUSER_SYNC_PASSWORD=False
|
||||
```
|
||||
|
||||
Then start the preview with `./run_preview.sh`. It applies migrations and ensures the
|
||||
admin account exists before starting the server. Existing passwords are preserved;
|
||||
set `DJANGO_SUPERUSER_SYNC_PASSWORD=True` for one start only if you intentionally
|
||||
need to reset the account password. This preview database is separate from the
|
||||
PostgreSQL database used by Docker and production.
|
||||
|
||||
## Management commands
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user