Whitelist all hosts when debugging
This commit is contained in:
parent
c790f39741
commit
0e1c5d10fb
|
@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import os
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
@ -23,9 +24,20 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
SECRET_KEY = 'ayr0nbsni^%h!xbeplx_v#b^cuj^adjg2*z7t@+ht7c=7*1u$e'
|
SECRET_KEY = 'ayr0nbsni^%h!xbeplx_v#b^cuj^adjg2*z7t@+ht7c=7*1u$e'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG_ENV = os.environ.get('DEBUG', False)
|
||||||
|
DEBUG = DEBUG_ENV or False
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['server']
|
PRODUCTION_HOST = 'example.com'
|
||||||
|
|
||||||
|
# production hosts
|
||||||
|
ALLOWED_HOSTS = [
|
||||||
|
'api.' + PRODUCTION_HOST,
|
||||||
|
]
|
||||||
|
|
||||||
|
if DEBUG:
|
||||||
|
ALLOWED_HOSTS += [
|
||||||
|
'*',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
Loading…
Reference in New Issue
Block a user