Friday, 29 December 2023

docker django with regarding to db changes

when ever a change to db has been made in app/core/models.py (including project init, or change to existing project)

you will need to bring up the docker containers and call :

docker-compose run app sh -c "python manage.py makemigrations core"


This will create either migrations for new table or table changes.



In docker-compose.yml

  command: >

      sh -c "python manage.py wait_for_db_conn &&

             python manage.py migrate &&

             python manage.py runserver 0.0.0.0:4000"

No comments:

Post a Comment