Alejandro Veintimilla
Alejandro Veintimilla

Reputation: 11523

Heroku. Django dumpdata

How can I get the data on Heroku and create a fixture I can load locally? heroku run python manage.py dumpdata --natural > data.json is the command, but how can I download the file?

Upvotes: 9

Views: 2870

Answers (2)

Daniel Hepper
Daniel Hepper

Reputation: 29967

Try adding to dashes to indicate the end of the command:

heroku run python manage.py dumpdata --natural-foreign -- > data.json

This should redirect the output to a local file.

Upvotes: 29

Mishu Lojan
Mishu Lojan

Reputation: 139

Try heroku pg:backups capture $ curl -o latest.dump - heroku pg:backups public-url

Upvotes: 0

Related Questions