customStorage manager in Sistemas app and zip views to upload the zip
This commit is contained in:
@@ -42,20 +42,15 @@ def read_env_file():
|
||||
#env_file = os.listdir(settings.BASE_DIR)
|
||||
storage = FileSystemStorage(location=settings.BASE_DIR)
|
||||
env_file= os.path.join(settings.BASE_DIR,'.env')
|
||||
|
||||
|
||||
lista =['asds', 'asdasd','sss','com' ,'pol.com']
|
||||
if storage.exists(env_file):
|
||||
with open(env_file, 'r') as file:
|
||||
data = file.read()
|
||||
data =re.findall('"([^"]*)"',data)
|
||||
|
||||
|
||||
for x in lista:
|
||||
data.append(x)
|
||||
res= ' '.join(data)
|
||||
final = '"'+res+'"'
|
||||
|
||||
final = '"'+res+'"'
|
||||
with open(env_file, 'w') as newFile:
|
||||
newFile.write("export hosts="+final)
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user