admin login
This commit is contained in:
0
app/core/__init__.py
Normal file
0
app/core/__init__.py
Normal file
6
app/core/config.py
Normal file
6
app/core/config.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
class Settings(BaseSettings):
|
||||
database_url: str = "sqlite:///db.sqlite"
|
||||
|
||||
settings = Settings()
|
||||
9
app/core/database.py
Normal file
9
app/core/database.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from sqlmodel import Session, create_engine
|
||||
from app.core.config import settings
|
||||
|
||||
connect_args = {"check_same_thread": False} # SQLite-specific argument for multithreading
|
||||
engine = create_engine(settings.database_url, echo=True, connect_args=connect_args)
|
||||
|
||||
def get_session():
|
||||
with Session(engine) as session:
|
||||
yield session
|
||||
0
app/core/security.py
Normal file
0
app/core/security.py
Normal file
Reference in New Issue
Block a user