Use local hosts only when debug is enabled
This commit is contained in:
parent
76fcefccf1
commit
02f64aef12
1 changed files with 7 additions and 7 deletions
|
@ -45,13 +45,13 @@ EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend"
|
||||||
DEBUG = os.getenv("DEBUG", "true").lower() == "true"
|
DEBUG = os.getenv("DEBUG", "true").lower() == "true"
|
||||||
TESTING = os.getenv("TESTING", "false").lower() == "true"
|
TESTING = os.getenv("TESTING", "false").lower() == "true"
|
||||||
|
|
||||||
ALLOWED_HOSTS = [
|
ALLOWED_HOSTS = []
|
||||||
"localhost",
|
if DEBUG:
|
||||||
"127.0.0.1",
|
ALLOWED_HOSTS.extend(["localhost", "127.0.0.1"])
|
||||||
]
|
|
||||||
HOST = os.getenv("HOST")
|
HOSTS = os.getenv("HOSTS")
|
||||||
if HOST:
|
if HOSTS:
|
||||||
ALLOWED_HOSTS.append(HOST)
|
ALLOWED_HOSTS.extend(HOSTS.split(";"))
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
Reference in a new issue