A template tag for generating a URL for a static file, with a version string which will be effectively unique based on the contents of the file.
Project description
A {% versioned_static %} template tag for generating a URL for a static file, with a version string which will be effectively unique based on the contents of the file.
Example
/static/css/global.css?v=a23bd10
Installation
# settings.py
INSTALLED_APPS += ['django_versioned_static_url']
Usage
The following template code:
{% load versioned_static %}
<link rel="stylesheet" href="{% versioned_static 'css/global.css' %}" />
Outputs:
<link rel="stylesheet" href="/static/css/global.css?v=feb0d0e" />
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-versioned-static-url-0.8.tar.gz
.
File metadata
- Download URL: django-versioned-static-url-0.8.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7adc0b1172b140d65ac8539fccbbdf238ddd6b7001e5fd77b7e9e11c1f889b99 |
|
MD5 | 8368d4e174eba8d46ce141707fb2a6c1 |
|
BLAKE2b-256 | 444a3a81224e72ac1140f687a5e9b2bc9659a5feb487848da4c044e137afa49d |