I don't get how this can be used anywhere except when you have 2 deployment targets which seems really limited.
Also checking for environments is done weirdly, why not use
if 'ENV' not in os.environ:
instead of
ENV = os.environ.get("ENV", None)
if ENV is None: