{"id":23605,"library":"django-sri","title":"django-sri","description":"Subresource Integrity (SRI) for Django. Generates integrity hashes for static files in templates. Current version: 0.8.0. Release cadence: infrequent, last release Oct 2024.","status":"active","version":"0.8.0","language":"python","source_language":"en","source_url":"https://github.com/RealOrangeOne/django-sri","tags":["django","sri","subresource-integrity","security","static-files"],"install":[{"cmd":"pip install django-sri","lang":"bash","label":"Install"}],"dependencies":[{"reason":"Required. Django project.","package":"Django","optional":false}],"imports":[{"wrong":"from sri.storage import SRIStaticFilesStorage","symbol":"calculate_integrity","correct":"from sri import calculate_integrity"},{"symbol":"Algorithm","correct":"from sri import Algorithm"},{"symbol":"hashers","correct":"from sri import hashers"}],"quickstart":{"code":"# settings.py\nINSTALLED_APPS = [\n    ...,\n    'sri',\n]\nSTATICFILES_STORAGE = 'sri.storage.SRIStaticFilesStorage'\n\n# In template\n{% load sri %}\n<script src=\"{% static 'js/app.js' %}\" {{ 'js/app.js'|sri }}></script>","lang":"python","description":"Add sri to INSTALLED_APPS, set storage backend, use sri filter in templates"},"warnings":[{"fix":"Change all imports from django_sri to sri.","message":"In version 0.8.0, the library module was renamed from django_sri to sri. Imports using 'from django_sri...' will break.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Run collectstatic after every static file change.","message":"The SRI hash is computed at deploy time (collectstatic) on the static file content. If files change after collectstatic, the hash will mismatch.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace SRI_ALGORITHM = 'sha384' with SRI_ALGORITHMS = ['sha384'].","message":"The old setting 'SRI_ALGORITHM' is deprecated in favor of 'SRI_ALGORITHMS' (list) in version 0.8.0.","severity":"deprecated","affected_versions":">=0.8.0"}],"env_vars":null,"search_vec":"'0.8.0':19 '2024':26 'cadenc':21 'current':17 'django':2,8,27 'django-sri':1 'file':14,35 'generat':9 'hash':11 'infrequ':22 'integr':5,10,31 'last':23 'oct':25 'releas':20,24 'secur':32 'sri':3,6,28 'static':13,34 'static-fil':33 'subresourc':4,30 'subresource-integr':29 'templat':16 'version':18","created_at":"2026-05-01T08:08:39.486313+00:00","updated_at":"2026-05-01T08:08:39.486313+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.8.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/RealOrangeOne/django-sri","docs":null,"changelog":null,"pypi":"https://pypi.org/project/django-sri/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","auth-security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}