Follow the steps below to get Sentry up and running on Heroku:
-
Create a new Heroku application. Replace "APP_NAME" with your application's name:
heroku apps:create APP_NAME
-
Add PostgresSQL to the application:
heroku addons:create heroku-postgresql:hobby-dev
-
Add Redis to the application:
heroku addons:create heroku-redis
-
Set Django's secret key for cryptographic signing and Sentry's shared secret for global administration privileges:
heroku config:set SECRET_KEY=$(python -c "import base64, os; print(base64.b64encode(os.urandom(40)).decode())")
-
Set the absolute URL to the Sentry root directory. The URL should not include a trailing slash. Replace the URL below with your application's URL:
heroku config:set SENTRY_URL_PREFIX=https://sentry-example.herokuapp.com
-
Deploy Sentry to Heroku:
git push heroku master
-
Run Sentry's database migrations:
heroku run "sentry --config=sentry.conf.py upgrade --noinput"
-
Create a user account for yourself:
heroku run "sentry --config=sentry.conf.py createuser"
That's it!
Follow the steps below, if you want to enable Sentry's email notifications:
-
Add either SendGrid or Mandrill add-on to your Heroku application:
heroku addons:create sendgrid
-
Set the reply-to email address for outgoing mail:
heroku config:set SERVER_EMAIL=sentry@example.com
-
Run the following command to update the requirements:
pip-contrib requirements.in
If the
pip-contrib
package isn't available in your machine, install it with:pip install pip-tools
-
Deploy the Heroku app:
git push heroku master
-
You might need to run migrations or update ENV variables, depending on Sentry's version you are upgrading to.