Skip to content

Instantly share code, notes, and snippets.

@inactivist
Created July 15, 2014 11:35
Show Gist options
  • Save inactivist/b59a26ae52e89f46eca9 to your computer and use it in GitHub Desktop.
Save inactivist/b59a26ae52e89f46eca9 to your computer and use it in GitHub Desktop.
is_heroku: Q&D method to detect running on Heroku container.
import os
def is_heroku():
"""Hack to return true if we're running inside a Heroku container.
Tested on Cedar stack.
"""
return os.environ.get('PYTHONHOME', '').find('.heroku') != -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment