feat: load environment variables from .env file and update .gitignore
This commit is contained in:
@@ -11,3 +11,4 @@ backend/test-results/
|
||||
frontend/cert.pem
|
||||
frontend/key.pem
|
||||
tmp/
|
||||
backend/.env*
|
||||
|
||||
Vendored
+1
-10
@@ -7,16 +7,7 @@
|
||||
"request": "launch",
|
||||
"module": "flask",
|
||||
"python": "${command:python.interpreterPath}",
|
||||
"env": {
|
||||
"FLASK_APP": "backend/main.py",
|
||||
"FLASK_DEBUG": "1",
|
||||
"SECRET_KEY": "dev-secret-key-change-in-production",
|
||||
"REFRESH_TOKEN_EXPIRY_DAYS": "90",
|
||||
"DIGEST_TOKEN_SECRET": "dev-digest-token",
|
||||
"VAPID_PUBLIC_KEY": "BNKkHdq45uLigohSG7c1TwlAo7ETncoRVLQK02LxHgu2P1DgSJD9njRMfbbzUsaTQGllvLBz7An1WiWsNYQhvKE",
|
||||
"VAPID_PRIVATE_KEY": "jNiZJT0UO4H861KmnCt874Fg6p5jDAyYKS4V2MZf8bQ",
|
||||
"FRONTEND_URL": "https://macbook:5173"
|
||||
},
|
||||
"envFile": "${workspaceFolder}/backend/.env",
|
||||
"args": [
|
||||
"run",
|
||||
"--host=0.0.0.0",
|
||||
|
||||
+5
-1
@@ -2,7 +2,9 @@ import logging
|
||||
import sys
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from flask import Flask, request, jsonify
|
||||
from pymongo import MongoClient
|
||||
|
||||
from api.admin_api import admin_api
|
||||
from api.auth_api import auth_api
|
||||
@@ -34,6 +36,9 @@ from utils.chore_expiry_notification_scheduler import start_chore_expiry_notific
|
||||
from utils.digest_scheduler import start_digest_scheduler
|
||||
from utils.state_expiry_scheduler import start_state_expiry_scheduler
|
||||
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
# Configure logging once at application startup
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
@@ -143,7 +148,6 @@ def start_background_threads():
|
||||
broadcaster.daemon = True
|
||||
broadcaster.start()
|
||||
|
||||
# TODO: implement users
|
||||
initializeImages()
|
||||
createDefaultTasks()
|
||||
createDefaultRewards()
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user