mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-30 02:50:03 -04:00
Updated config to be string based not class based and removed old style live/staging files.
This commit is contained in:
@@ -13,8 +13,9 @@ from flask import (
|
||||
current_app,
|
||||
request,
|
||||
g,
|
||||
url_for
|
||||
)
|
||||
url_for)
|
||||
|
||||
from config import configs
|
||||
from flask._compat import string_types
|
||||
from flask.globals import _lookup_req_object
|
||||
from flask_login import LoginManager
|
||||
@@ -69,7 +70,7 @@ current_service = LocalProxy(partial(_lookup_req_object, 'service'))
|
||||
def create_app():
|
||||
application = Flask(__name__)
|
||||
|
||||
application.config.from_object(os.environ['NOTIFY_ADMIN_ENVIRONMENT'])
|
||||
application.config.from_object(configs[os.environ['NOTIFY_ADMIN_ENVIRONMENT']])
|
||||
|
||||
init_app(application)
|
||||
logging.init_app(application)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
__travis_commit__ = "dev"
|
||||
__time__ = "dev"
|
||||
__travis_job_number__ = "dev"
|
||||
__travis_commit__ = ""
|
||||
__time__ = "2016-07-04:17:22:35"
|
||||
__travis_job_number__ = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
files:
|
||||
-
|
||||
destination: /home/ubuntu/notifications-admin
|
||||
destination: /home/notify-app/notifications-admin
|
||||
source: /
|
||||
hooks:
|
||||
AfterInstall:
|
||||
|
||||
11
config.py
11
config.py
@@ -3,7 +3,6 @@ from datetime import timedelta
|
||||
|
||||
|
||||
class Config(object):
|
||||
|
||||
DEBUG = False
|
||||
ADMIN_CLIENT_SECRET = os.environ['ADMIN_CLIENT_SECRET']
|
||||
ADMIN_CLIENT_USER_NAME = os.environ['ADMIN_CLIENT_USER_NAME']
|
||||
@@ -92,9 +91,9 @@ class Live(Config):
|
||||
|
||||
|
||||
configs = {
|
||||
'development': 'config.Development',
|
||||
'test': 'config.Test',
|
||||
'preview': 'config.Preview',
|
||||
'staging': 'config.Staging',
|
||||
'live': 'config.Live'
|
||||
'development': Development,
|
||||
'test': Test,
|
||||
'preview': Preview,
|
||||
'staging': Staging,
|
||||
'live': Live
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user