[Django] #30521: Default error webpages are not correctly-formed html pages

9 views
Skip to first unread message

Django

unread,
May 28, 2019, 11:23:31 AM5/28/19
to django-...@googlegroups.com
#30521: Default error webpages are not correctly-formed html pages
------------------------------------------------+------------------------
Reporter: Ruben Garcia | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Error reporting | Version: 2.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 1 |
------------------------------------------------+------------------------
The default page served for the 404 error in "DEBUG=False" mode is (django
2.2.1):
<h1>Not Found</h1><p>The requested resource was not found on this
server.</p>

I would expect that by default, a full webpage is sent to the user, thus:
<html>
<body>
<h1>Not Found</h1><p>The requested resource was not found on this
server.</p>
</body>
</html>

In "DEBUG=True" mode, the webpage served is correct html:
<!DOCTYPE html>
<html lang="en">
...
</html>

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

Django

unread,
May 29, 2019, 1:30:09 AM5/29/19
to django-...@googlegroups.com
#30521: Default error webpages are not correctly-formed html pages.
--------------------------------------+------------------------------------

Reporter: Ruben Garcia | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Error reporting | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by felixxm):

* ui_ux: 1 => 0
* version: 2.2 => master
* stage: Unreviewed => Accepted


Comment:

Thanks for the report. I'm not sure if we should complicate all default
error pages. It is [https://docs.djangoproject.com/en/stable/ref/views
/#error-views documented] that by default error views produce a very
simple messages and it is also still recommended as good practice to
provide custom templates in order to present pretty error pages to the
user. You can also
[https://docs.djangoproject.com/en/stable/topics/http/views/#customizing-
error-views customize error views]. To sum up default error pages are just
a fallback, but OK we can accept this as a simple cleanup.

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

Django

unread,
May 29, 2019, 9:26:19 AM5/29/19
to django-...@googlegroups.com
#30521: Default error webpages are not correctly-formed html pages.
-------------------------------------+-------------------------------------
Reporter: Ruben Garcia | Owner: Alexandre
Type: | Varas
Cleanup/optimization | Status: assigned

Component: Error reporting | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Alexandre Varas):

* owner: (none) => Alexandre Varas
* status: new => assigned


Comment:

I'll start working on this ticket.

Following @felixxm comment I'll see if a *simple* solution can be applied.

My opinion is that Django should use the corresponding format or at least
to be consistent with other responses.

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

Django

unread,
Jun 5, 2019, 3:00:07 PM6/5/19
to django-...@googlegroups.com
#30521: Default error webpages are not correctly-formed html pages.
-------------------------------------+-------------------------------------
Reporter: Ruben Garcia | Owner: Alexandre
Type: | Varas
Cleanup/optimization | Status: assigned
Component: Error reporting | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Alexandre Varas):

* has_patch: 0 => 1


Comment:

Here's my patch [https://github.com/django/django/pull/11446 PR]. It adds
html to the response of all default error pages. Any comments?

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

Django

unread,
Jun 7, 2019, 2:18:27 AM6/7/19
to django-...@googlegroups.com
#30521: Default error webpages are not correctly-formed html pages.
-------------------------------------+-------------------------------------
Reporter: Ruben Garcia | Owner: Alexandre
Type: | Varas
Cleanup/optimization | Status: assigned
Component: Error reporting | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"3fb0a1a67f0ca3e03db59a876f87e8d0828872c4" 3fb0a1a6]:
{{{
#!CommitTicketReference repository=""
revision="3fb0a1a67f0ca3e03db59a876f87e8d0828872c4"
Refs #30521 -- Added tests for content of default error pages.
}}}

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

Django

unread,
Jun 7, 2019, 2:18:29 AM6/7/19
to django-...@googlegroups.com
#30521: Default error webpages are not correctly-formed html pages.
-------------------------------------+-------------------------------------
Reporter: Ruben Garcia | Owner: Alexandre
Type: | Varas
Cleanup/optimization | Status: closed

Component: Error reporting | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"c498f088c584ec3aff97409fdc11b39b28240de9" c498f088]:
{{{
#!CommitTicketReference repository=""
revision="c498f088c584ec3aff97409fdc11b39b28240de9"
Fixed #30521 -- Fixed invalid HTML in default error pages.
}}}

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

Reply all
Reply to author
Forward
0 new messages