Import config from .env
This commit is contained in:
3
.env.example
Normal file
3
.env.example
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
API_URI=
|
||||||
|
API_KEY=
|
||||||
|
API_TEAM=
|
2
app.py
2
app.py
@ -1,3 +1,5 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
@ -9,12 +9,11 @@ class Config:
|
|||||||
with environment variables when available.
|
with environment variables when available.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, config_file_path: str = "config.yaml"):
|
def __init__(self):
|
||||||
"""
|
"""
|
||||||
Initialize the configuration manager.
|
Initialize the configuration manager.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
config_file_path: Path to the YAML configuration file. Defaults to "config.yaml".
|
config_file_path: Path to the YAML configuration file. Defaults to "config.yaml".
|
||||||
"""
|
"""
|
||||||
# Load environment variables from .env file if it exists
|
|
||||||
load_dotenv()
|
load_dotenv()
|
@ -22,3 +22,4 @@ typing_extensions==4.13.2
|
|||||||
urllib3==2.4.0
|
urllib3==2.4.0
|
||||||
Werkzeug==3.1.3
|
Werkzeug==3.1.3
|
||||||
Flask==3.1.0
|
Flask==3.1.0
|
||||||
|
python-dotenv=1.1.0
|
Reference in New Issue
Block a user