[Django] #31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering the page poorly in compatibility mode.

30 views
Skip to first unread message

Django

unread,
Feb 26, 2020, 3:52:04 AM2/26/20
to django-...@googlegroups.com
#31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.
---------------------------------------------+------------------------
Reporter: Petter Strandmark | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.0
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 |
---------------------------------------------+------------------------
Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.

The fix is simple, just add `<meta http-equiv="X-UA-Compatible"
content="IE=11" />` to the base template. I'll make a PR for this.

It's pretty annoying without this, CSS can break and the pages look
generally poor.

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

Django

unread,
Feb 26, 2020, 4:32:50 AM2/26/20
to django-...@googlegroups.com
#31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.
-----------------------------------+--------------------------------------

Reporter: Petter Strandmark | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.0
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 Carlton Gibson):

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


Comment:

[https://docs.microsoft.com/en-us/previous-versions/windows/internet-
explorer/ie-developer/compatibility/jj676915(v=vs.85)?redirectedfrom=MSDN
As per Microsoft's advice] we use the HTML5 document type: `<!DOCTYPE
html>`. Document modes have been deprecated since 2013 and "should not be
used".

If you want this you can create your own `admin/base.html`, as per the
[https://docs.djangoproject.com/en/3.0/howto/overriding-templates/
Overriding templates docs].

Give it the following content to add the meta tag to the existing block:

{{{
{% extends 'admin/base.html' %}

{% block extrahead %}


<meta http-equiv="X-UA-Compatible" content="IE=11" />

{% endblock %}
}}}

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

Django

unread,
Feb 26, 2020, 5:15:53 AM2/26/20
to django-...@googlegroups.com
#31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.
-----------------------------------+--------------------------------------

Reporter: Petter Strandmark | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.0
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
-----------------------------------+--------------------------------------
Changes (by Petter Strandmark):

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


Comment:

No that does not work, unfortunately, since the X-UA-Compatible tag needs
to come before the stylesheets.

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

Django

unread,
Feb 26, 2020, 5:21:19 AM2/26/20
to django-...@googlegroups.com
#31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.
-----------------------------------+--------------------------------------

Reporter: Petter Strandmark | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.0
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 Petter Strandmark):

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


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

Django

unread,
Feb 26, 2020, 5:28:42 AM2/26/20
to django-...@googlegroups.com
#31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.
-----------------------------------+--------------------------------------

Reporter: Petter Strandmark | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.0
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
-----------------------------------+--------------------------------------
Changes (by Petter Strandmark):

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


Comment:

From the documentation:

"The X-UA-Compatible header isn't case sensitive; however, it must appear
in the header of the webpage (the HEAD section) before all other elements
except for the title element and other meta elements."

--
Ticket URL: <https://code.djangoproject.com/ticket/31309#comment:4>

Django

unread,
Feb 26, 2020, 5:33:24 AM2/26/20
to django-...@googlegroups.com
#31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.
-----------------------------------+--------------------------------------

Reporter: Petter Strandmark | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution: needsinfo

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 Carlton Gibson):

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


Comment:

> ... the X-UA-Compatible tag needs to come before the stylesheets.

There's no block for that. Possibly we could add a block but I go back to
MS's docs saying that the tag shouldn't be used.

Ref #31032 here: it's not clear that IE is still supported (vs Edge).
Maybe an email to the DevelopersMailingList is appropriate to clarify the
situation.

--
Ticket URL: <https://code.djangoproject.com/ticket/31309#comment:5>

Django

unread,
Feb 26, 2020, 5:39:06 AM2/26/20
to django-...@googlegroups.com
#31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.
-----------------------------------+--------------------------------------

Reporter: Petter Strandmark | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution: needsinfo

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):

You've target IE11 [https://docs.microsoft.com/en-us/previous-
versions/windows/internet-explorer/ie-developer/dev-
guides/bg182625(v=vs.85)?redirectedfrom=MSDN but, the MS Docs again]:

> Starting with IE11, document modes are deprecated and should no longer
be used.

You may need to narrow down **exactly** what CSS elements aren't working.
Maybe those can be addressed but removing features for a previous
generation browser isn't likely to win friends.

Given Claude's comment on #31032

> ...especially since the responsive patch

Have you tried overriding the `responsive` block in `admin/base.html`?
Maybe removing those stylesheets is enough to simplify it?

(TBH using Edge seems the best option here.)

--
Ticket URL: <https://code.djangoproject.com/ticket/31309#comment:6>

Django

unread,
Feb 26, 2020, 5:53:48 AM2/26/20
to django-...@googlegroups.com
#31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.
-----------------------------------+--------------------------------------

Reporter: Petter Strandmark | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution: needsinfo

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):

Hi Peter.

If you can prepare some more details on the problems we can look at
whether we can (and want) to address them.

Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/31309#comment:7>

Django

unread,
Nov 18, 2020, 2:29:05 PM11/18/20
to django-...@googlegroups.com
#31309: Django admin site needs X-UA-Compatible meta tag to prevent IE rendering
the page poorly in compatibility mode.
-----------------------------------+--------------------------------------

Reporter: Petter Strandmark | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution: needsinfo

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 Carsten Fuchs):

* cc: Carsten Fuchs (added)


Comment:

To my understanding, the IE can be set, per policy, to render all intranet
pages in "compatibility mode" (IE7?), which seems to cause problems with
modern CSS.
In my tests,
{{{
<meta http-equiv="X-UA-Compatible" content="IE=edge">
}}}
fixes the problem.
https://stackoverflow.com/questions/6771258/what-does-meta-http-equiv-x
-ua-compatible-content-ie-edge-do has a lot of information about this.

--
Ticket URL: <https://code.djangoproject.com/ticket/31309#comment:8>

Reply all
Reply to author
Forward
0 new messages