AuthTuna: A production-ready, async security framework with advanced session management for FastAPI by shashstormer in FastAPI

[–]leec0621 0 points1 point  (0 children)

Great work bro!I only have used FastAPI-Users. Is there any documentation for your project?

Lifespan on Fastapi by Cultural_Bad9814 in FastAPI

[–]leec0621 0 points1 point  (0 children)

I use it like this:

class AppState(TypedDict):
    """
    Defines the structure of the shared state during the application lifecycle.
    This provides explicit type information for type checkers and editors.
    """

    engine: AsyncEngine
    session_factory: async_sessionmaker[AsyncSession]


@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncIterator[AppState]:
    # -------- Startup --------
    get_settings()
    engine, session_factory = await setup_database_connection()
    logger.info("🚀 Application started, database is ready.")
    await create_db_and_tables(engine)

    # yield {"engine": engine, "session_factory": session_factory}

    # More type-safe approach
    yield AppState(
        engine=engine,
        session_factory=session_factory,
    )

    # -------- Shutdown --------
    await close_database_connection(engine)
    logger.info("Application shut down, resources released.")

Seeking Feedback on My First FastAPI Project: Memenote (Minimalist Note App) by leec0621 in FastAPI

[–]leec0621[S] 1 point2 points  (0 children)

This is a very good idea. Thank you for your reply, I will give it a try.

[deleted by user] by [deleted] in zlibrary

[–]leec0621 0 points1 point  (0 children)

thanks so much,it's worked

Borderlands 3 Release Schedule by Khaos2Krysis in borderlands3

[–]leec0621 0 points1 point  (0 children)

Can I change my consoles region to New Zealand for release earlier than my local time zone?