Reputation: 75
Does Heroku provide any environment variables that are specific to its production environment, so an app can easily distinguish between development/productions settings?
Right now I am just doing a test for HOME=/Users/myname for the development environment but that would not work if other developers want to work on my app.
Upvotes: 1
Views: 75
Reputation: 75
Ended up just testing to see if the app was running with Gunicorn or on the Flask development server. Still...would be nice if Heroku gave some indication of the different environments.
if not "gunicorn" in os.environ.get("SERVER_SOFTWARE", ""):
Config = DevelopmentConfig
else:
Config = ProductionConfig
Upvotes: 0
Reputation: 33824
Heroku applications are always in production -- Heroku doesn't distinguish between development and production at all.
Heroku expects you to do development and testing on either your laptop, or another Heroku app completely separate from your production app.
Upvotes: 1