Search code examples
djangoheroku

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?


Solution

  • 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.