From d89d28539e2f711ae3bbfdf50a0cee62e779714f Mon Sep 17 00:00:00 2001 From: Finn Christiansen Date: Sun, 11 Jun 2023 15:26:15 +0200 Subject: [PATCH] :bug: fixed wsgi file --- rgb.wsgi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rgb.wsgi b/rgb.wsgi index cf190ea..4a253b2 100644 --- a/rgb.wsgi +++ b/rgb.wsgi @@ -8,7 +8,14 @@ activate_this = os.path.join(os.path.dirname(__file__), 'bin/activate_this.py') with open(activate_this) as file_: exec(file_.read(), dict(__file__=activate_this)) +from app import create_app -from app import app as application -application.secret_key = 'something super SUPER secret' +def application(environ, start_response): + ENVIRONMENT_VARIABLES = [ + 'APP_CONFIG', + ] + for key in ENVIRONMENT_VARIABLES: + os.environ[key] = environ.get(key, '') + app = create_app(os.getenv('APP_CONFIG', 'production')) + return app(environ, start_response)