Commit 2d556d9
authored
The Dev Center guide instructs users running this project locally to visit
`http://localhost:5001`, however, some users don't read the guide properly
and instead use the URL output by gunicorn to the logs:
```
[2024-05-27 09:52:07 +0000] [1] [INFO] Listening at: http://0.0.0.0:5001 (1)
```
Django's default debug mode `ALLOWED_HOSTS` only includes `localhost`
and `127.0.0.1` etc, so as a result using `0.0.0.0` would result in a
`DisallowedHost` error:
https://docs.djangoproject.com/en/5.0/ref/settings/#allowed-hosts
According to RFC5735 `0.0.0.0` shouldn't be a routable IP, however, browsers
and some other clients choose to treat it like localhost:
https://stackoverflow.com/a/55646032
Adding it to `ALLOWED_HOSTS` is safe, so we might as well do so to
improve the UX when users don't follow the guide properly.
See:
https://devcenter.heroku.com/admin/articles/feedback/2161#27486
https://devcenter.heroku.com/admin/articles/feedback/2161#27738
GUS-W-14193867.
1 parent f15864a commit 2d556d9
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments