Merge pull request #912 from tobiasge/localhost_allowed_host
Ensure that '*' or 'localhost' is always in ALLOWED_HOSTS
This commit is contained in:
commit
1403f52d04
|
@ -58,6 +58,9 @@ _BASE_DIR = dirname(dirname(abspath(__file__)))
|
||||||
#
|
#
|
||||||
# Example: ALLOWED_HOSTS = ['netbox.example.com', 'netbox.internal.local']
|
# Example: ALLOWED_HOSTS = ['netbox.example.com', 'netbox.internal.local']
|
||||||
ALLOWED_HOSTS = environ.get('ALLOWED_HOSTS', '*').split(' ')
|
ALLOWED_HOSTS = environ.get('ALLOWED_HOSTS', '*').split(' ')
|
||||||
|
# ensure that '*' or 'localhost' is always in ALLOWED_HOSTS (needed for health checks)
|
||||||
|
if '*' not in ALLOWED_HOSTS and 'localhost' not in ALLOWED_HOSTS:
|
||||||
|
ALLOWED_HOSTS.append('localhost')
|
||||||
|
|
||||||
# PostgreSQL database configuration. See the Django documentation for a complete list of available parameters:
|
# PostgreSQL database configuration. See the Django documentation for a complete list of available parameters:
|
||||||
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
|
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
|
||||||
|
|
Loading…
Reference in New Issue