changes of db config add .env file and rename of ex_formate.html to file_formate.html

This commit is contained in:
2026-01-10 13:05:13 +05:30
parent 54f3d16b57
commit 5afe8e7096
7 changed files with 126 additions and 19 deletions

View File

@@ -1,11 +1,29 @@
import os
# project base url
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
class Config:
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:root@localhost/comparisondb"
# secret key
SECRET_KEY = os.getenv("SECRET_KEY", "dev-secret-key")
# Database varibles
DB_DIALECT = os.getenv("DB_DIALECT")
DB_DRIVER = os.getenv("DB_DRIVER")
DB_USER = os.getenv("DB_USER")
DB_PASSWORD = os.getenv("DB_PASSWORD")
DB_HOST = os.getenv("DB_HOST")
DB_PORT = os.getenv("DB_PORT")
DB_NAME = os.getenv("DB_NAME")
# database connection url
SQLALCHEMY_DATABASE_URI = (
f"{DB_DIALECT}+{DB_DRIVER}://"
f"{DB_USER}:{DB_PASSWORD}@"
f"{DB_HOST}:{DB_PORT}/"
f"{DB_NAME}"
)
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = "secret123"
UPLOAD_FOLDER = "app/static/uploads/"
# uploads folder path
UPLOAD_FOLDER = os.path.join(BASE_DIR, "static", "uploads")
# file extension
ALLOWED_EXTENSIONS = {"xlsx", "xls", "csv"}