Jul 24 - Update Rich-text editor to enhance table editor 5
This commit is contained in:
@@ -202,6 +202,23 @@ def create_app():
|
||||
def healthz():
|
||||
return {"status": "ok"}
|
||||
|
||||
@app.context_processor
|
||||
def inject_asset_url():
|
||||
"""`asset_url('css/style.css')` → the static URL with a `?v=<mtime>`
|
||||
cache-buster, so an edited CSS/JS file is always re-fetched instead of
|
||||
being served stale from the browser/proxy cache."""
|
||||
from flask import url_for
|
||||
|
||||
def asset_url(filename):
|
||||
try:
|
||||
version = int(os.path.getmtime(
|
||||
os.path.join(app.static_folder, filename)))
|
||||
except OSError:
|
||||
version = 0
|
||||
return url_for("static", filename=filename, v=version)
|
||||
|
||||
return {"asset_url": asset_url}
|
||||
|
||||
return app
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user