mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-26 07:25:51 +03:00
[GH-ISSUE #499] Inconsistency in Documentation: ALLOWED_HOSTS #369
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#369
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jandermannderkann on GitHub (Apr 17, 2021).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/499
Hi, i noticed that in the configuration Documentation for the ALLOWED_HOSTS variable it reads:
yet the line right beneath shows an example:
which does not use Strings.
I propse to change the example to
ALLOWED_HOSTS="my-hc.example.org","alternative-name.example.org"@cuu508 commented on GitHub (Apr 21, 2021):
Thanks for reporting!
Yes, the "A list of strings" bit makes it sound like it would accept data in Python notation. But the example is correct – the value should be a string with comma-separated host/domain names. I just updated the wording to hopefully make it less confusing.
@jandermannderkann commented on GitHub (Apr 26, 2021):
Thanks for looking into this.! :)
Im not entirely sure, my issue is resolved though.
I encountered this problem, when i put the following line into my local_settings:
ALLOWED_HOSTS="example.com"which resulted in an error, while
ALLOWED_HOSTS=["example.com"]did not throw any errors.Detailed Report:
Steps to reproduce:
Do fresh installation:
(
mkdir /tmp/test && git clone https://github.com/healthchecks/healthchecks.git /tmp/test/hc && python3 -m venv /tmp/test/env && source /tmp/test/env/bin/activate && pip install --upgrade pip && pip install -r /tmp/test/hc/requirements.txt)Step 1:
echo 'ALLOWED_HOSTS="localhost" ' > /tmp/test/hc/hc/local_settings.py && python /tmp/test/hc/manage.py runservergoto localhost:8000 and see
Behavior:
Invalid HTTP_HOST header: 'localhost:8000'. You may need to add 'localhost' to ALLOWED_HOSTS.look at settings information at bottom of page and see:
ALLOWED_HOSTS | 'localhost'expected behavior: no error page
@cuu508 commented on GitHub (Apr 26, 2021):
Thanks, appreciate the precise steps to reproduce.
The Server Configuration page describes the environment variables Healthchecks reads and uses. The syntax in environment variables and in local_settings.py is slightly different.
In environment variable you would use:
In local_settings.py you would use:
There are two reasons I didn't want to use Python syntax in environment variables: