19 lines
439 B
Python
19 lines
439 B
Python
import os
|
|
|
|
|
|
def config_from_environ(app, prefix=None):
|
|
if not prefix:
|
|
prefix = app.config.get('APP_NAME')
|
|
|
|
for name, value in os.environ.items():
|
|
if name.startswith(prefix):
|
|
if isinstance(value, str):
|
|
value = value.strip()
|
|
|
|
if value:
|
|
app.config[name[len(prefix) + 1:]] = value
|
|
|
|
|
|
class BaseConfig:
|
|
JWT_TOKEN_LOCATION = 'json'
|
|
JWT_IDENTITY_CLAIM = 'sub' |