mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-11 07:42:20 -05:00
Pass application name in from start scripts
- allows logger to log as correct application
This commit is contained in:
@@ -27,10 +27,12 @@ encryption = Encryption()
|
||||
api_user = LocalProxy(lambda: _request_ctx_stack.top.api_user)
|
||||
|
||||
|
||||
def create_app():
|
||||
def create_app(app_name=None):
|
||||
application = Flask(__name__)
|
||||
|
||||
application.config.from_object(os.environ['NOTIFY_API_ENVIRONMENT'])
|
||||
if app_name:
|
||||
application.config['NOTIFY_APP_NAME'] = app_name
|
||||
|
||||
init_app(application)
|
||||
db.init_app(application)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
from app import notify_celery, create_app
|
||||
|
||||
application = create_app()
|
||||
application = create_app('delivery')
|
||||
application.app_context().push()
|
||||
|
||||
Reference in New Issue
Block a user