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 ...@@ -67,6 +67,10 @@ USE_TZ = True
# stopping requests submitted with a fake HTTP Host header. # stopping requests submitted with a fake HTTP Host header.
ALLOWED_HOSTS = ['localhost', '127.0.0.1'] 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 ----------------------------------------------------------- # Sessions settings -----------------------------------------------------------
SESSION_COOKIE_AGE = 3600*23 SESSION_COOKIE_AGE = 3600*23
SESSION_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True
......
...@@ -43,10 +43,9 @@ if 'silk' in INSTALLED_APPS: ...@@ -43,10 +43,9 @@ if 'silk' in INSTALLED_APPS:
# some headers which we want to keep hidden. So to be safe, we only allow # 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 # it to be used through this server. You need to configure a SOCKS proxy
# on your local machine to use DJDT (see admin docs). # on your local machine to use DJDT (see admin docs).
# FIXME INTERNAL_IPS = [
#INTERNAL_IPS = [ INTERNAL_IP_ADDRESS,
# socket.gethostbyname(SERVER_HOSTNAME), ]
#]
# Adjust ADMINS for dev instances # Adjust ADMINS for dev instances
ADMINS = [ ADMINS = [
......
...@@ -21,7 +21,7 @@ DATABASES = { ...@@ -21,7 +21,7 @@ DATABASES = {
# Set up allowed hosts # Set up allowed hosts
SERVER_FQDN = socket.getfqdn() SERVER_FQDN = socket.getfqdn()
SERVER_HOSTNAME = socket.gethostname() SERVER_HOSTNAME = INTERNAL_HOSTNAME
ALLOWED_HOSTS += [SERVER_FQDN, '{hostname}.ligo.org'.format( ALLOWED_HOSTS += [SERVER_FQDN, '{hostname}.ligo.org'.format(
hostname=SERVER_HOSTNAME)] hostname=SERVER_HOSTNAME)]
......
...@@ -46,7 +46,7 @@ if 'silk' in INSTALLED_APPS: ...@@ -46,7 +46,7 @@ if 'silk' in INSTALLED_APPS:
# it to be used through this server. You need to configure a SOCKS proxy # it to be used through this server. You need to configure a SOCKS proxy
# on your local machine to use DJDT (see admin docs). # on your local machine to use DJDT (see admin docs).
INTERNAL_IPS = [ INTERNAL_IPS = [
socket.gethostbyname(SERVER_HOSTNAME), INTERNAL_IP_ADDRESS,
] ]
# Adjust ADMINS for dev instances # 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