Tips

X-Content-Type-Options=nosniff error


Context

I deployed a Django project where everything worked fine, then a second one where all the static content (images, CSS, JS) didn’t work.

Solution

You need to paste this in the “head” tag of the project’s HTML. Preferably in your base template, otherwise it could get tedious.

<meta content="text/html; charset=UTF-8; X-Content-Type-Options=nosniff" http-equiv="Content-Type" />

Useful links:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options

https://stackoverflow.com/questions/18337630/what-is-x-content-type-options-nosniff