-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
32 lines (24 loc) · 882 Bytes
/
Copy pathconfig.py
File metadata and controls
32 lines (24 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright Hersel Giannella
from pydantic_settings import BaseSettings
class Config(BaseSettings):
APP_HOST: str = "127.0.0.1"
APP_PORT: int = 5000
DEBUG: bool = True
SECRET_KEY: str = "default_secret_key"
# Database Configuration
DB_HOST: str = "localhost"
DB_PORT: int = 3306
DB_USER: str = "portfolio_user"
DB_PASSWORD: str = "portfolio_password"
DB_NAME: str = "portfolio_db"
@property
def SQLALCHEMY_DATABASE_URI(self) -> str:
"""Construct MariaDB connection string"""
return f"mysql+pymysql://{self.DB_USER}:{self.DB_PASSWORD}@{self.DB_HOST}:{self.DB_PORT}/{self.DB_NAME}"
SQLALCHEMY_TRACK_MODIFICATIONS: bool = False
SQLALCHEMY_ECHO: bool = False # Set to True for SQL query debugging
class Config:
env_file = ".env"
config = Config()