mirror of
https://github.com/kevin-DL/full-stack-fastapi-postgresql.git
synced 2026-01-13 02:25:26 +00:00
* ♻️ Refactor backend, update DB session handling * ✨ Add mypy config and plugins * ➕ Use Python-jose instead of PyJWT as it has some extra functionalities and features * ✨ Add/update scripts for test, lint, format * 🔧 Update lint and format configs * 🎨 Update import format, comments, and types * 🎨 Add types to config * ✨ Add types for all the code, and small fixes * 🎨 Use global imports to simplify exploring with Jupyter * ♻️ Import schemas and models, instead of each class * 🚚 Rename db_session to db for simplicity * 📌 Update dependencies installation for testing
23 lines
385 B
Python
23 lines
385 B
Python
import logging
|
|
|
|
from app.db.init_db import init_db
|
|
from app.db.session import SessionLocal
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def init() -> None:
|
|
db = SessionLocal()
|
|
init_db(db)
|
|
|
|
|
|
def main() -> None:
|
|
logger.info("Creating initial data")
|
|
init()
|
|
logger.info("Initial data created")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|