Flask Autoversion
Automatically version static file paths. When actively developing a web application, you may experience issues with browsers caching your static content. With this extension you can easily use the function in your templates that will update the query added on to the file path to bust the browser cache.
Installation
Install the extension:
pip install Flask-Autoversion
Set Up
A typical setup:
from flask import Flask, render_template
from flaskext.autoversion import Autoversion
app = Flask(__name__)
app.autoversion = True
Autoversion(app)
@app.route('/')
def hello_world():
return render_template("home.html")
Setting app.autoversion to True will append a query string with the file last-modified timestamp as the value.
Versioning Static Files in Jinja
<link rel="stylesheet" type="text/css" href="{{ static_autoversion('app.css') }}">
Metadata
Release files for Flask-Autoversion 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Flask-Autoversion-0.2.0.tar.gz | 3.4 kB | Details |
Release files / Flask-Autoversion-0.2.0.tar.gz
| Download URL | Flask-Autoversion-0.2.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d02b67107efabcfc33ac61260d77a674c1d8b1233264b5d4c9cc34d8dae74ed1
|
|
BLAKE2b-256 checksum How to use checksums |
edc97bc73eb0ef83eaf82d3fca1ae2c6f75c32b4ef390b5d69eeaca3804c1716
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.2
|