#33803: Add crossorigin attribute to django admin templates
----------------------------------+--------------------------------------
Reporter: fcrozatier | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: crossorigin COEP | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by Adam Johnson):
* status: new => closed
* resolution: => invalid
Comment:
No, the answer here is not to change Django. When setting COEP to require-
corp, you have two options to allow cross-origin assets to work. *Either*
you set the `crossorigin` attribute, or the assets are served with a CORP
header declaring cross-origin loading to be allowed. Thus, you should
change your static asset hosting to add this CORP header. I blogged about
these headers here: https://adamj.eu/tech/2021/05/01/how-to-set-coep-coop-
corp-security-headers-in-django/
Also with HTTP 2+ it's more efficient to serve your assets from the same
domain, as they can be served on a single connection. Most sites should be
doing this. Whitenoise is a popular solution for doing so with minimal
configuration: https://whitenoise.evans.io/en/stable/ .
--
Ticket URL: <https://code.djangoproject.com/ticket/33803#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018194c2dfc2-ff700acf-062e-42ed-aa03-32f6c5c2ed02-000000%40eu-central-1.amazonses.com.