mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
New config style
This commit is contained in:
@@ -16,6 +16,8 @@ from app.clients.sms.loadtesting import LoadtestingClient
|
|||||||
from app.clients.email.aws_ses import AwsSesClient
|
from app.clients.email.aws_ses import AwsSesClient
|
||||||
from app.clients.statsd.statsd_client import StatsdClient
|
from app.clients.statsd.statsd_client import StatsdClient
|
||||||
from app.encryption import Encryption
|
from app.encryption import Encryption
|
||||||
|
from config import configs
|
||||||
|
|
||||||
|
|
||||||
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f"
|
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f"
|
||||||
DATE_FORMAT = "%Y-%m-%d"
|
DATE_FORMAT = "%Y-%m-%d"
|
||||||
@@ -38,7 +40,7 @@ api_user = LocalProxy(lambda: _request_ctx_stack.top.api_user)
|
|||||||
def create_app(app_name=None):
|
def create_app(app_name=None):
|
||||||
application = Flask(__name__)
|
application = Flask(__name__)
|
||||||
|
|
||||||
application.config.from_object(os.environ['NOTIFY_API_ENVIRONMENT'])
|
application.config.from_object(configs[os.environ['NOTIFY_ENVIRONMENT']])
|
||||||
|
|
||||||
if app_name:
|
if app_name:
|
||||||
application.config['NOTIFY_APP_NAME'] = app_name
|
application.config['NOTIFY_APP_NAME'] = app_name
|
||||||
|
|||||||
10
config.py
10
config.py
@@ -136,9 +136,9 @@ class Live(Config):
|
|||||||
|
|
||||||
|
|
||||||
configs = {
|
configs = {
|
||||||
'development': 'config.Development',
|
'development': Development,
|
||||||
'test': 'config.Test',
|
'test': Test,
|
||||||
'live': 'config.Live',
|
'live': Live,
|
||||||
'staging': 'config.Staging',
|
'staging': Staging,
|
||||||
'preview': 'config.Preview'
|
'preview': Preview
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user