Files
notifications-admin/application.py
Chris Hill-Scott 58d3d70a7c Expose application as a variable
This is what Gunicorn is looking for when it’s running the app.

Renaming this variable to `app` has caused the app to break once
deployed on PaaS.

This commit also renames `app` to `flask_app` to make it clear which
app is wrapping which other app.
2018-11-29 14:02:20 +00:00

17 lines
385 B
Python

import os
from flask import Flask
from whitenoise import WhiteNoise
from app import create_app
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'app', 'static')
STATIC_URL = 'static/'
flask_app = Flask('app')
create_app(flask_app)
application = WhiteNoise(flask_app.wsgi_app, STATIC_ROOT, STATIC_URL, max_age=WhiteNoise.FOREVER)