realpython/dockerizing-django

production migrate command

Open

#22 opened on Apr 13, 2016

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Python (493 forks)batch import
hacktoberfest

Repository metrics

Stars
 (1,326 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

In your guide you have:

$ docker-compose build
$ docker-compose -f production.yml up -d
$ docker-compose run web /usr/local/bin/python manage.py migrate

But shouldn't that be?

$ docker-compose -f production.yml build
$ docker-compose -f production.yml run web python -u manage.py migrate
$ docker-compose -f production.yml up -d

Needs to specify the file each time. And migrate should run before up incase there are migrations to run.

Contributor guide