I need to programatically determine if my app is running in development or not, so that I can provide sandbox values for a variety of constants and methods.
Something like:
if app.development: # Live mode
FREEBASE_USER = "spam123"
FREEBASE_PSWD = "eggs123"
FREEBASE = freebase
else: # Sandbox mode
FREEBASE_USER = "spam"
FREEBASE_PSWD = "eggs"
FREEBASE = freebase.sandbox
import os
DEV = os.environ['SERVER_SOFTWARE'].startswith('Development')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With