Skip to content

Commit 7f68516

Browse files
remove python-dotenv
1 parent 70f1763 commit 7f68516

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

requirements.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
jsonschema
2-
python-dotenv
32
wslink
43
websocket-client

src/opengeodeweb_viewer/vtkw_server.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ def add_arguments(parser):
2828
"--data_folder_path", default=os.environ.get("DATA_FOLDER_PATH"), help="Path to the folder where data is stored"
2929
)
3030

31+
parser.add_argument(
32+
"--host", default=os.environ.get("DEFAULT_HOST"), help="Host to run on"
33+
)
34+
3135
@staticmethod
3236
def configure(args):
3337
# Standard args
@@ -81,10 +85,6 @@ def initialize(self):
8185

8286

8387
def run_server():
84-
basedir = os.path.abspath(os.path.dirname(__file__))
85-
dot_env_path = os.path.join(basedir, "../../.env")
86-
if os.path.isfile(dot_env_path):
87-
dotenv.load_dotenv(dot_env_path)
8888
PYTHON_ENV = os.environ.get("PYTHON_ENV", default="prod").strip().lower()
8989
if PYTHON_ENV == "prod":
9090
prod_config()
@@ -96,11 +96,15 @@ def run_server():
9696

9797
_Server.add_arguments(parser)
9898
args = parser.parse_args()
99+
print("COUCOU", flush=True)
100+
if not "host" in args:
101+
print(f"Defaulting to {os.environ.get('DEFAULT_HOST')}", flush=True)
102+
args.host = os.environ.get("DEFAULT_HOST")
99103
if not "port" in args or args.port == 8080:
100104
args.port = os.environ.get("DEFAULT_PORT")
101105
if "data_folder_path" in args:
102106
os.environ["DATA_FOLDER_PATH"] = args.data_folder_path
103-
args.host = os.environ.get("HOST")
107+
104108
print(f"{args=}", flush=True)
105109
_Server.configure(args)
106110
server.start_webserver(options=args, protocol=_Server)

0 commit comments

Comments
 (0)