Add config.py

This commit is contained in:
Santiago Lo Coco 2024-10-25 22:06:01 +02:00
parent f596b2287f
commit 11ef9cabfb
2 changed files with 9 additions and 8 deletions

View File

@ -1,16 +1,9 @@
import os
from dotenv import load_dotenv
from flask import Flask, render_template
from api import api
from config import API_HOST, DATABASE_URI
from db import get_endpoints_from_db, init_db
load_dotenv()
DATABASE_URI = os.getenv("DATABASE")
API_HOST = os.getenv("API_HOST")
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False

8
src/config.py Normal file
View File

@ -0,0 +1,8 @@
import os
from dotenv import load_dotenv
load_dotenv()
DATABASE_URI = os.getenv("DATABASE")
API_HOST = os.getenv("API_HOST")