From d975e42713bea3ad0622f2e7be013ad928d9c7f2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 21:57:58 +0530 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate (#454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 6.0.0 → 6.1.0](https://github.com/PyCQA/flake8/compare/6.0.0...6.1.0) - [github.com/pre-commit/mirrors-prettier: v3.0.0 → v3.0.1](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0...v3.0.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1a01651..6592e777 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,7 +58,7 @@ repos: - sqlalchemy - types-all - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 additional_dependencies: @@ -80,7 +80,7 @@ repos: language_version: python3 exclude: (^tests|funnel/loginproviders/flask_oauth.py) - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0 + rev: v3.0.1 hooks: - id: prettier args: ['--single-quote', '--trailing-comma', 'es5'] From 812c1d7dff9a0a8566c021fdde01305c5fd3ed7e Mon Sep 17 00:00:00 2001 From: Kiran Jonnalagadda Date: Wed, 9 Aug 2023 00:53:38 +0530 Subject: [PATCH 2/2] Load config from environment (#455) --- boxoffice/__init__.py | 2 +- wsgi.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/boxoffice/__init__.py b/boxoffice/__init__.py index ca7bf182..d6e28977 100644 --- a/boxoffice/__init__.py +++ b/boxoffice/__init__.py @@ -70,7 +70,7 @@ def default(o: Any) -> Any: # --- Configure ------------------------------------------------------------------------ -coaster.app.init_app(app) +coaster.app.init_app(app, ['py', 'env'], env_prefix=['FLASK', 'APP_BOXOFFICE']) db.init_app(app) migrate = Migrate(app, db) rq.init_app(app) diff --git a/wsgi.py b/wsgi.py index c54f7be3..e2084789 100644 --- a/wsgi.py +++ b/wsgi.py @@ -1,7 +1,14 @@ import os.path import sys +from flask.cli import load_dotenv +from flask.helpers import get_load_dotenv + __all__ = ['application'] sys.path.insert(0, os.path.dirname(__file__)) +if get_load_dotenv(): + load_dotenv() + +# pylint: disable=wrong-import-position from boxoffice import app as application # isort:skip