Heroku setup

Rebecca Sutton Koeser edited this page Aug 9, 2013 · 1 revision

Here are instructions for setting up and running the serendipomatic codebase on heroku. Relevant heroku documentation: quick start and django instructions

Login to Heroku and create a new app - I'll use serendip-test as an example here. Make sure you install the heroku tools linked in the official quick start documentation above.

Add the Heroku git repository as a remote to your cloned copy of the serendipomatic code, e.g.

git remote add heroku git@heroku.com:serendip-test.git

Add a new development postgres db to use with the site (see also Heroku Postgres documentation ):

heroku addons:add heroku-postgresql:dev

Note that if you have multiple heroku apps configured in the same environment, you will have to specify the app via --app serendip-test on all of the heroku commands.

Wait for the database to be ready, determine the url, and then promote it to primary database:

heroku pg:wait
heroku config | grep HEROKU_POSTGRESQL
heroku pg:promote HEROKU_POSTGRESQL_PINK_URL

Use git to push the code to heroku:

git push heroku master

Set environment variables for sensitive settings that would normally go into localsettings.py (fill in values for all the secret and api keys):

heroku config:set HEROKU=true DJANGO_DEBUG=true DJANGO_SECRET_KEY= DPLA_API_KEY= EUROPEANA_API_KEY=
FLICKR_API_KEY= ZOTERO_CONSUMER_KEY= ZOTERO_CONSUMER_SECRET= TROVE_API_KEY=

Run the django command to set up the database:

heroku run python manage.py syncdb

Open your heroku app in the browser and hopefully everything works!

heroku open

(still to do: nltk stopwords data handling/cleanup)