#36514: Improve ALLOWED_HOSTS error message: show both values
------------------------------------+--------------------------------------
     Reporter:  Klaas van Schelven  |                    Owner:  (none)
         Type:  New feature         |                   Status:  closed
    Component:  HTTP handling       |                  Version:  5.2
     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
------------------------------------+--------------------------------------
Comment (by Carlton Gibson):

 The `localhost` suggestion is taking the aberrant case as normal.
 Standardly the Host header is the domain of the site being requested, so
 something like `djangoproject.com`, rather than `localhost`.

 In that case, the error message makes perfect sense:

 {{{
 Invalid HTTP_HOST header: 'djangoproject.com'. You may need to add
 'djangoproject.com' to ALLOWED_HOSTS.
 }}}

 If you **really** want to make requests to `localhost`, then absolutely it
 should be added to `ALLOWED_HOSTS`.

 I don't think we can account for every possible misunderstanding here.

 To the original point: the contents of `ALLOWED_HOSTS` should not be part
 of the error message.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36514#comment:5>
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 visit 
https://groups.google.com/d/msgid/django-updates/01070198808eca7c-e5ac966c-2c27-4f69-8bc1-34da394d78ca-000000%40eu-central-1.amazonses.com.

Reply via email to