I have a Django webapp, and I\'d like to check if it\'s running on the Heroku stack (for conditional enabling of debugging, etc.) Is there any simple way to do this? An envi
First set the environment variable ON_HEROKU on heroku:
ON_HEROKU
$ heroku config:set ON_HEROKU=1
Then in settings.py
settings.py
import os # define if on heroku environment ON_HEROKU = 'ON_HEROKU' in os.environ