export db data, re-apply migrations, import db data#
1
2
3
4
|
pipenv run python manage.py dumpdata > fixtures/db.json
pipenv run python manage.py flush
pipenv run python manage.py migrate
pipenv run python manage.py loaddata fixtures/db.json
|
Remove entries from db.json:
1
2
3
|
"model":"contenttypes.contenttype",
"model":"sessions.session",
"model":"auth.permission",
|
migrating 2.7 to 3.7.1
Need to purge heroku cache, and to do that, need to install the heroku-repo plugin; without it, will see › Warning: repo:purge_cache is not a heroku command.
1
2
3
4
|
heroku plugins:install heroku-repo
heroku repo:purge_cache -a eatables-test
# or
heroku repo:reset -a eatables-test
|
Also needed to upgrade the heroku stack; without this, the install was failing at installing pip
:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.7.1
remote: -----> Installing pip
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to eatables-test.
remote:
|
Upgrade with:
1
|
heroku stack:set heroku-18 -a eatables-test
|