Skip to main content

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.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-versioned-static-url-0.8.tar.gz (4.8 kB) Copy SHA256 hash SHA256 Source None Jul 4, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page