From c6f0a05f48e85d8bac547c5c4eaf5b98d64d73a9 Mon Sep 17 00:00:00 2001 From: catborise Date: Thu, 4 Jun 2020 14:32:51 +0300 Subject: [PATCH] django2 style conversion of setting environment --- console/novncd | 2 +- console/tunnel.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/console/novncd b/console/novncd index 4ed17be..d3aa445 100755 --- a/console/novncd +++ b/console/novncd @@ -7,7 +7,7 @@ import django DIR_PATH = os.path.dirname(os.path.abspath(__file__)) ROOT_PATH = os.path.abspath(os.path.join(DIR_PATH, '..', '')) -os.environ["DJANGO_SETTINGS_MODULE"] = "webvirtcloud.settings" +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webvirtcloud.settings') CERT = DIR_PATH + '/cert.pem' if ROOT_PATH not in sys.path: diff --git a/console/tunnel.py b/console/tunnel.py index c7c19d6..539a269 100644 --- a/console/tunnel.py +++ b/console/tunnel.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # This class provide from VirtManager project, from console.py # file.