mirror of https://github.com/jumpserver/jumpserver
perf: 修改写法
parent
38e8e8734d
commit
148bf3b894
|
@ -76,12 +76,10 @@ ALLOWED_DOMAINS = [host.split('/')[0] for host in ALLOWED_DOMAINS if host]
|
|||
DEBUG_HOSTS = ['127.0.0.1', 'localhost']
|
||||
DEBUG_PORT = ['8080', '80', '443', '4200', '9528']
|
||||
if DEBUG:
|
||||
for host in DEBUG_HOSTS:
|
||||
for port in DEBUG_PORT:
|
||||
ALLOWED_DOMAINS.append('{}:{}'.format(host, port))
|
||||
DEBUG_HOST_PORTS = ['{}:{}'.format(host, port) for host in DEBUG_HOSTS for port in DEBUG_PORT]
|
||||
ALLOWED_DOMAINS.extend(DEBUG_HOST_PORTS)
|
||||
|
||||
ALLOWED_HOSTS = list(set(['.' + host.split(':')[0] for host in ALLOWED_DOMAINS]))
|
||||
|
||||
print("ALLOWED_HOSTS: ", ALLOWED_HOSTS)
|
||||
|
||||
# https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-CSRF_TRUSTED_ORIGINS
|
||||
|
|
Loading…
Reference in New Issue