Opened 4 years ago

Closed 4 years ago

#32564 closed New feature (wontfix)

admin/base.html : Add block "end_of_body" for JS includes

Reported by: Thomas Güttler Owned by: nobody
Component: contrib.admin Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I would like to add JavaScript includes at the end of the HTML, before </body>

I created a PR which implements it:

https://github.com/django/django/pull/13913

It is very simple:

 <!-- END Container -->
+ {% block end_of_body %}{% endblock %}
 </body> 
 </html>

Change History (3)

comment:1 by Carlton Gibson, 4 years ago

As per the discussion on the PR, I'd like us to establish whether this is still needed with modern browsers and defer and async &co. 🤔
(It's not a big addition, so in principle, yes, but if we can do without...)

Thomas, can I ask that you do a bit of reading around?

comment:2 by Matthias Kestenholz, 4 years ago

I'm definitely no expert and I haven't done any measurements, but here's a chart: https://caniuse.com/script-defer

<script src="..." defer> seems to be enormously well supported, certainly by all browsers that are the target of Django's admin interface.

comment:3 by Mariusz Felisiak, 4 years ago

Resolution: wontfix
Status: newclosed

I agree with previous comments. I don't think that we need an extra block.

Note: See TracTickets for help on using tickets.
Back to Top