Provide a first working approach to the fingerprinting of static resources.
- Django doesn't have a framework for this
-
Install using pip:
pip install django-fingerprinting
-
Add django_fingerprinting to your INSTALLED_APPS list.
INSTALLED_APPS = ['django_fingerprinting',] + INSTALLED_APPS
To add a replacement of static resources simply set FINGERPRINTING
as a dictionary
in your settings file.
FINGERPRINTING = {
'css/global.css': 'css/global-234f-2321db-74fce-34de.css'
}
This settings option can of course be auto generated at some point.
In order to fingerprint something in your template simply include:
{% load fingerprinting %}
<head>
<script src="{% static "js/myjavascrip.js"|fingerprinting %}"></script>
</head>