Skip to content

output files containing hashes of when static files were last updated

License

Notifications You must be signed in to change notification settings

marinko-peso/django-static-hashes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-static-hashes

Output files containing hashes of when static files were last updated.

Installing

  1. Run pip install git+https://github.com/marinko-peso/django-static-hashes.git
  2. Add 'static_hashes' to INSTALLED APPS
  3. Add the following to your settings:
STATIC_HASHES_STATIC_DIRS = ... #list of folders containing static files you want to get hashes for
STATIC_HASHES_OUTPUT_DIR = ... #path/to/output/javascript/and/json

Create the hashes

  1. Run manage.py collect_static_hashes. This may take some time.
  2. Take a look at the files defined in STATIC_HASHES_OUTPUT_DIR

Use the hashes in the browser

  1. Add {% load static_hashes_tags %} to your template
  2. Add {% get_static_hashes %} to your template
  3. In javascript you can now acess hashes.

Related to this blog post

About

output files containing hashes of when static files were last updated

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%