Skip to content
Snippets Groups Projects
Verified Commit efda70bb authored by Tanner Prestegard's avatar Tanner Prestegard
Browse files

Clean up hostnames in settings files

parent 415ccba3
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,10 @@ USE_TZ = True
# stopping requests submitted with a fake HTTP Host header.
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
# Internal hostname and IP address
INTERNAL_HOSTNAME = socket.gethostname()
INTERNAL_IP_ADDRESS = socket.gethostbyname(INTERNAL_HOSTNAME)
# Sessions settings -----------------------------------------------------------
SESSION_COOKIE_AGE = 3600*23
SESSION_COOKIE_SECURE = True
......
......@@ -43,10 +43,9 @@ if 'silk' in INSTALLED_APPS:
# some headers which we want to keep hidden. So to be safe, we only allow
# it to be used through this server. You need to configure a SOCKS proxy
# on your local machine to use DJDT (see admin docs).
# FIXME
#INTERNAL_IPS = [
# socket.gethostbyname(SERVER_HOSTNAME),
#]
INTERNAL_IPS = [
INTERNAL_IP_ADDRESS,
]
# Adjust ADMINS for dev instances
ADMINS = [
......
......@@ -21,7 +21,7 @@ DATABASES = {
# Set up allowed hosts
SERVER_FQDN = socket.getfqdn()
SERVER_HOSTNAME = socket.gethostname()
SERVER_HOSTNAME = INTERNAL_HOSTNAME
ALLOWED_HOSTS += [SERVER_FQDN, '{hostname}.ligo.org'.format(
hostname=SERVER_HOSTNAME)]
......
......@@ -46,7 +46,7 @@ if 'silk' in INSTALLED_APPS:
# it to be used through this server. You need to configure a SOCKS proxy
# on your local machine to use DJDT (see admin docs).
INTERNAL_IPS = [
socket.gethostbyname(SERVER_HOSTNAME),
INTERNAL_IP_ADDRESS,
]
# Adjust ADMINS for dev instances
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment