Files
notifications-admin/application.py
Chris Hill-Scott d47e0482d4 Tell browsers not to re-fetch static assets
Since we version our asset filenames there’s no need for a browser to
ever fetch the same file twice. It should always cache fetch from its
own cache.

The accepted way to effect this behaviour is using the expires header,
which is what this argument to `WhiteNoise` does.
2018-11-29 13:22:52 +00:00

16 lines
367 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, max_age=WhiteNoise.FOREVER)