Version: 2.10

Heroku

Configuration

Git should already be initialized within the repo. You only need to add the heroku remote with your app-name:

heroku git:remote -a 'app-name'
heroku buildpacks:set heroku/nodejs
heroku buildpacks:add heroku/python
heroku addons:create heroku-postgresql:hobby-dev
heroku addons:create heroku-redis:hobby-dev
heroku addons:create sendgrid:starter
heroku config:set ALLOWED_HOSTS='<your hosts here>'
heroku config:set NODE_MODULES_CACHE=false
heroku config:set NPM_CONFIG_PRODUCTION=false
heroku config:set SECRET_KEY='<your secret key here>'
note

Heroku’s storage is volatile. This means that all instances of your application have separate disks and lose all changes made to the local disk each time the application is restarted. The best approach is to use cloud storage such as Amazon S3. See Storing Files on Amazon S3 for configuration details.

note

This guide does not cover the deployment of either the dashboard or the storefront. Contributions are welcome!

Deployment

git push heroku master

Preparing the database

heroku run python manage.py migrate

Updating currency exchange rates

You should run this command periodically. The best way to ensure this is done is by using Heroku’s Scheduler service.

To add it to our application:

heroku addons:create scheduler

Then log into your Heroku account, find the Heroku Scheduler add-on in the active add-on list, and have it run the following command on a daily basis:

python manage.py update_exchange_rates --all