kp_static_version is a simple Django app to add a version number to static files and force browsers to use the latest version of the file.
Project description
kp_static_version is a simple Django app to add a version number to static files and force browsers to use the latest version of the file.
Quick start
Install django-kp-static-version:
pip install django-kp-static-version
Add “polls” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'kp_static_version', ]
Load templatetags into your template:
{% load kp_static %}
Load your static file:
<script src="{% vstatic "js/sample.js" %}"></script>
If in your settings.py the variable DEBUG = True then a random number will be generated for development otherwise the value KP_STATIC_VERSION will be used:
KP_STATIC_VERSION = "0.5"
The result:
<script src="/static/js/sample.js?v=0.5"></script>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-kp-static-version-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57d10cab1943e478ff8aa54c3b9db159956020188d7dd05abc4ae127c29433fe |
|
MD5 | 2009ebef223c9495e133c3a043d9278e |
|
BLAKE2b-256 | e5d5b452ac8ce9f58da002060487686d9ba3f3d359a3be9b50bcea0a72210f07 |