A new Django middleware package, django-integrity-policy, has been released to support the Integrity-Policy HTTP response header. This header, supported in Firefox 145+ and Chrome 138+, allows websites to require integrity attributes on all scripts and stylesheets, enforcing subresource integrity as a defense against supply chain attacks. The post explains how to configure the middleware and pair it with django-sri for generating hashed static file tags. The author also shares that the package was built using Claude via two prompts in about 20 minutes of LLM-assisted development, saving several hours of grunt work.

5m read timeFrom adamj.eu
Post cover image
Table of contents
django-integrity-policyLLM generationThe futureFin
5.3K Impressions1 Comment