Skip to content

Loading flatblocks data

T.J. Alumbaugh edited this page Jan 4, 2016 · 1 revision

On the live heroku app, execute

python manage.py dumpdata flatblocks --output flatblocks_heroku.json
python sendfile.py

This will put the latest data on S3 (you need Heroku collaborator access and AWS credentials to do this). If you don't have those but just want to run locally, ask the development team for the latest JSON file. They will give it to you. Then, on your local setup, execute as follows:

cp flatblocks_heroku flatblocks.json
python manage.py loaddata flatblocks.json

This might fail if the flatblocks_flatblock relation is already in your DB. I was able to get around this by copying the table and dropping the existing table.

The consequences of lost data here is small because you likely just have stub data for the flatblocks entries anyway. After this command succeeds, you now have all of the flatblocks text from the website on your local box!