From 94e0559bc45d7a1ef35f0850ab65474665b2a4ab Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Fri, 19 Apr 2019 14:23:34 +0100 Subject: Settings: PARENT_HOST will be added to ALLOWED_HOSTS in debug mode --- pydis_site/settings.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index b938b36d..0bd4957b 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -202,6 +202,11 @@ DEFAULT_HOST = 'home' if DEBUG: PARENT_HOST = env('PARENT_HOST', default='pythondiscord.local:8000') + + if ":" in PARENT_HOST: + ALLOWED_HOSTS.append(PARENT_HOST.split(":", 1)[0]) + else: + ALLOWED_HOSTS.append(PARENT_HOST) else: PARENT_HOST = env('PARENT_HOST', default='pythondiscord.com') -- cgit v1.2.3