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 | Provenance | Actions |
|---|---|---|---|---|
| Flask-Autoversion-0.2.0.tar.gz | 3.4 kB | Without provenance | Details for Flask-Autoversion-0.2.0.tar.gz |
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
|
Security for Flask-Autoversion 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.