A Django 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
canonical-webteam.versioned-static
=======================
A ``{% versioned_static %}`` Django 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
------------
.. code:: python
# settings.py
INSTALLED_APPS += ['django_versioned_static_url']
Usage
-----
The following template code:
.. code:: html
{% load versioned_static %}
<link rel="stylesheet" href="{% versioned_static 'css/global.css' %}" />
Outputs:
.. code:: html
<link rel="stylesheet" href="/static/css/global.css?v=feb0d0e" />
=======================
A ``{% versioned_static %}`` Django 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
------------
.. code:: python
# settings.py
INSTALLED_APPS += ['django_versioned_static_url']
Usage
-----
The following template code:
.. code:: html
{% load versioned_static %}
<link rel="stylesheet" href="{% versioned_static 'css/global.css' %}" />
Outputs:
.. code:: html
<link rel="stylesheet" href="/static/css/global.css?v=feb0d0e" />
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
File details
Details for the file canonicalwebteam.versioned-static-1.0.1.tar.gz
.
File metadata
- Download URL: canonicalwebteam.versioned-static-1.0.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a66b561229c40d58ae69daff6c8c879f8962e9f05dd92ddf87ad08349aac0cf5 |
|
MD5 | 077c2c634de81cd76f568b70f1adf8e8 |
|
BLAKE2b-256 | ab3e47b003d11dbc7ef795149e21e25ac163f095e5e4001c41150d28e861cbff |