diff --git a/modules/initialize.py b/modules/initialize.py index 77effcd..a4579df 100644 --- a/modules/initialize.py +++ b/modules/initialize.py @@ -266,14 +266,20 @@ def get_config(branchname): # allowed_hosts are the ip addresses and hostnames # 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.append(dataobject.project.extendedname) - _allowed.append(dataobject.project.host) + _allowed.add(dataobject.project.extendedname) + _allowed.add(dataobject.project.host) if 'allowed_hosts' in config['django']: for allowed in config['django']['allowed_hosts']: - _allowed.append(allowed) + _allowed.add(allowed) dataobject.addbranch('paths')