This repository has been archived by the owner on Jul 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Make init_for calls automatic #6
Comments
The Flask-Environments extension, which does something similar, uses Further, defaults should be specified in a single place, so this should be in the |
Please file issues in all apps with the same title and the following text:
|
This was referenced May 4, 2017
This was referenced May 4, 2017
This was referenced May 4, 2017
This was referenced May 4, 2017
If we move the parsing of |
jace
added a commit
that referenced
this issue
May 4, 2017
Please use this commit’s changes as the template for changes to all apps.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
hgapp-based apps currently require
init_for
to be called explicitly. The Flask extension ecosystem however expects init to happen implicitly during module load and often provides no hook for config to be loaded.We should switch to implicit config by (a) reading an environment variable named
FLASK_ENV
for the expected environment (defaultdev
) and (b) call it at the bottom of__init__.py
itself, instead of having an external caller (runserver.py
,website.py
, etc).Coaster's
manage.py
expectsenv
andinit_for
parameters. Those must be removed. This therefore requires a coordinated switch across all repositories.Production deployments must have
export FLASK_ENV="production"
specified somewhere globally, like in/etc/rc.local
.The text was updated successfully, but these errors were encountered: