[Django] #32564: admin/base.html : Add block "end_of_body" for JS includes

16 views
Skip to first unread message

Django

unread,
Mar 17, 2021, 11:41:23 AM3/17/21
to django-...@googlegroups.com
#32564: admin/base.html : Add block "end_of_body" for JS includes
------------------------------------------+------------------------
Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 3.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
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>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32564>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 17, 2021, 11:54:43 AM3/17/21
to django-...@googlegroups.com
#32564: admin/base.html : Add block "end_of_body" for JS includes
--------------------------------+--------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Carlton Gibson):

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?

--
Ticket URL: <https://code.djangoproject.com/ticket/32564#comment:1>

Django

unread,
Mar 17, 2021, 1:17:54 PM3/17/21
to django-...@googlegroups.com
#32564: admin/base.html : Add block "end_of_body" for JS includes
--------------------------------+--------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Matthias Kestenholz):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/32564#comment:2>

Django

unread,
Mar 17, 2021, 4:13:19 PM3/17/21
to django-...@googlegroups.com
#32564: admin/base.html : Add block "end_of_body" for JS includes
--------------------------------+--------------------------------------

Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => wontfix


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/32564#comment:3>

Reply all
Reply to author
Forward
0 new messages