Update dotenv support to make operative (#564)

b46ada9f72 added support for dotenv files to be loaded in lieu of
actual environment variables. This code has since been neglected across
infrastructure changes that removed the need for an env file, moved
its location, and changed dependency management style.

This won't be operative in production (and already isn't, since there'd
be an ImportError on 'dotenv' if so) but makes some local testing
setups more convenient.
This commit is contained in:
Snakes 2023-03-29 22:59:34 -04:00 committed by GitHub
parent 1cf017c42a
commit 1647b4cf20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 5 deletions

View file

@ -50,7 +50,8 @@ if bool_from_string(environ.get("ENFORCE_PRODUCTION", True)) and app.debug:
if environ.get("SITE_ID") is None:
from dotenv import load_dotenv
load_dotenv(dotenv_path=Path("env"))
load_dotenv(dotenv_path=Path("bootstrap/site_env"))
load_dotenv(dotenv_path=Path("env"), override=True)
# ...and let's add the flask profiler if it's enabled...