changed django.allowed_hosts to type set from type list, bc I found that names were being duplicated in the allowedhosts, so I'm side stepping that by using set
This commit is contained in:
parent
9106127a16
commit
2f71995f39
1 changed files with 10 additions and 4 deletions
|
|
@ -266,14 +266,20 @@ def get_config(branchname):
|
||||||
# allowed_hosts are the ip addresses and hostnames
|
# allowed_hosts are the ip addresses and hostnames
|
||||||
# that this instance is allowed to run on
|
# that this instance is allowed to run on
|
||||||
|
|
||||||
dataobject.project.django.allowedhosts = list()
|
# use the Set variable type b/c we don't want duplicated
|
||||||
|
# of any of the ip addresses or host names
|
||||||
|
#
|
||||||
|
# this is because I found that sometimes "extendedname" is the same
|
||||||
|
# as host or as PROJECT_HOST.EXTENSION
|
||||||
|
|
||||||
|
dataobject.project.django.allowedhosts = set()
|
||||||
_allowed = getattr(dataobject.project.django, 'allowedhosts')
|
_allowed = getattr(dataobject.project.django, 'allowedhosts')
|
||||||
_allowed.append(dataobject.project.extendedname)
|
_allowed.add(dataobject.project.extendedname)
|
||||||
_allowed.append(dataobject.project.host)
|
_allowed.add(dataobject.project.host)
|
||||||
|
|
||||||
if 'allowed_hosts' in config['django']:
|
if 'allowed_hosts' in config['django']:
|
||||||
for allowed in config['django']['allowed_hosts']:
|
for allowed in config['django']['allowed_hosts']:
|
||||||
_allowed.append(allowed)
|
_allowed.add(allowed)
|
||||||
|
|
||||||
dataobject.addbranch('paths')
|
dataobject.addbranch('paths')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue