mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-11 15:43:45 -05:00
Currently it’s not configured properly, so isn’t having any effect. This change makes it wrap the Flask app, so it intercepts any requests for static content. Follows the pattern documented in http://whitenoise.evans.io/en/stable/flask.html#enable-whitenoise
16 lines
339 B
Python
16 lines
339 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/'
|
|
|
|
app = Flask('app')
|
|
|
|
create_app(app)
|
|
app.wsgi_app = WhiteNoise(app.wsgi_app, STATIC_ROOT, STATIC_URL)
|