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
Built Distribution
Close
Hashes for canonicalwebteam.versioned-static-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 564edf14e89b1121a3f0ca9d14717cefe21c223667d0e4256c1c47900ae8d3c6 |
|
MD5 | 9a42af1ff5545534b5f725584c887311 |
|
BLAKE2b-256 | d8c81ff7b7e5814a58c6ea31f01556bc09369f65252897bc34d654bbc7c5ce4c |
Close
Hashes for canonicalwebteam.versioned_static-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9800c59e4a3fcf47e5305a8736e77b95bd03e03ef0683c4e762127b05f57a355 |
|
MD5 | 71e1c01d594583ff0b7bde52827f2517 |
|
BLAKE2b-256 | 32a65803fcd0d2176eb21df2c2a9431e3a46f0b27bb568a02f1dacb270571a3b |