Load local .env file in dev mode (Will make same change to other projects)

This commit is contained in:
Peter Stockings
2024-04-07 22:30:28 +10:00
parent ff422e9536
commit 353093809f
2 changed files with 8 additions and 1 deletions

6
app.py
View File

@@ -11,6 +11,12 @@ from utils import count_prs_over_time, get_date_info, get_people_and_exercise_re
from flask_htmx import HTMX
import minify_html
from urllib.parse import quote
import os
from dotenv import load_dotenv
# Load environment variables from .env file in non-production environments
if os.environ.get('FLASK_ENV') != 'production':
load_dotenv()
app = Flask(__name__)
app.config.from_pyfile('config.py')

View File

@@ -9,4 +9,5 @@ minify-html==0.10.3
jinja2-fragments==0.3.0
Werkzeug==2.2.2
numpy==1.19.5
pandas==1.3.1
pandas==1.3.1
python-dotenv==1.0.1