From 8e0afa11337752a12cec4c06493d692c5db4394b Mon Sep 17 00:00:00 2001 From: ronnyabraham Date: Sun, 8 May 2022 16:50:21 +0300 Subject: [PATCH] had to reset allowed hosts to a type list, bc when it gets generated into the django settings file as a type set, it cannot be read by the django library --- modules/initialize.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/initialize.py b/modules/initialize.py index a4579df..68fbbd1 100644 --- a/modules/initialize.py +++ b/modules/initialize.py @@ -271,9 +271,10 @@ def get_config(branchname): # # this is because I found that sometimes "extendedname" is the same # as host or as PROJECT_HOST.EXTENSION + # + # when done, convert to list and set allowedhosts to the new list - dataobject.project.django.allowedhosts = set() - _allowed = getattr(dataobject.project.django, 'allowedhosts') + _allowed = set() _allowed.add(dataobject.project.extendedname) _allowed.add(dataobject.project.host) @@ -281,6 +282,10 @@ def get_config(branchname): for allowed in config['django']['allowed_hosts']: _allowed.add(allowed) + dataobject.project.django.allowedhosts = list(_allowed) + + print(type(dataobject.project.django.allowedhosts)) + dataobject.addbranch('paths') dataobject.paths.addbranch('project')