-
-
Notifications
You must be signed in to change notification settings - Fork 374
Closed
Description
I am wondering if it would be possible to add a command and/or documentation around the best way (if it makes sense) to run migrate (or other manage.py commands) without actually starting the web server.
The rationale behind this is that there are some cases where you want to populate the database or run some other management command without having the actual web server running (such as things you want to ensure happen before any celery tasks are sent).
The best I could come up with so far was to do something like:
## Bring up just Redis and Postgres
COMPOSE_PROFILES=cache,db docker compose up
## In another shell
docker compose run --no-deps --rm python3 manage.py migrate
Do you have any thoughts on whether this is an OK thing to do? Is there a better way to run some pre-start commands (which may take arbitrarily long).
Metadata
Metadata
Assignees
Labels
No labels