dockerizing-django icon indicating copy to clipboard operation
dockerizing-django copied to clipboard

initial migration for todo app should be done before run migrate

Open glebmikha opened this issue 5 years ago • 2 comments

Before running: /usr/local/bin/python manage.py migrate

it's necessary to run: /usr/local/bin/python manage.py makemigrations todo

to make initial migrations for todo app itself. Otherwise model Item won't be created and app won't start.

And exec should be used instead of run in both cases: docker-compose exec web /usr/local/bin/python manage.py migrate

It makes sense to add these commands to sh script and run it as an entrypoint for the web container.

Fill free to assign it to me if you want me to pr).

glebmikha avatar Apr 03 '19 01:04 glebmikha

Thank's @glebmikha, that helped me as well!

greg-amato avatar Apr 12 '19 05:04 greg-amato

Needed this, Very Nice! Thanks. Good to know how to build individual migrations too

ramseylove avatar Jan 02 '20 20:01 ramseylove