From 83bb28e47ad19dd97ca68ca31724ec77e8da2b1d Mon Sep 17 00:00:00 2001 From: Rafi Date: Tue, 28 Feb 2023 15:13:55 +0800 Subject: [PATCH] Add APP_URL environment variable --- chatgpt_ui_server/settings.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chatgpt_ui_server/settings.py b/chatgpt_ui_server/settings.py index b5d7d64..4894e17 100644 --- a/chatgpt_ui_server/settings.py +++ b/chatgpt_ui_server/settings.py @@ -30,9 +30,12 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = os.getenv('DEBUG', False) == 'True' -ALLOWED_HOSTS = [os.getenv('APP_URL', '*')] +ALLOWED_HOSTS = [os.getenv('APP_DOMAIN', '*')] -CSRF_TRUSTED_ORIGINS=[os.getenv('APP_URL', 'http://localhost:9000')] +CSRF_TRUSTED_ORIGINS=[ + 'http://' + os.getenv('APP_DOMAIN', 'localhost:9000'), + 'https://' + os.getenv('APP_DOMAIN', 'localhost:9000') +] # Application definition