forked from orbit-oss/flask
rename to FLASK_SKIP_DOTENV, add docs, test
This commit is contained in:
parent
bac5d6b9f4
commit
5965cb7e1c
4 changed files with 50 additions and 7 deletions
|
|
@ -68,6 +68,21 @@ def get_debug_flag():
|
|||
return val.lower() not in ('0', 'false', 'no')
|
||||
|
||||
|
||||
def get_load_dotenv(default=True):
|
||||
"""Get whether the user has disabled loading dotenv files by setting
|
||||
:envvar:`FLASK_SKIP_DOTENV`. The default is ``True``, load the
|
||||
files.
|
||||
|
||||
:param default: What to return if the env var isn't set.
|
||||
"""
|
||||
val = os.environ.get('FLASK_SKIP_DOTENV')
|
||||
|
||||
if not val:
|
||||
return default
|
||||
|
||||
return val.lower() in ('0', 'false', 'no')
|
||||
|
||||
|
||||
def _endpoint_from_view_func(view_func):
|
||||
"""Internal helper that returns the default endpoint for a given
|
||||
function. This always is the function name.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue