FastAPI Lifespan vs on_event: A Practical Decision Guide
Compare FastAPI's lifespan context manager with legacy on_event hooks. Learn how to safely initialize DB pools and shared resources using app.state for better testability and ASGI compliance.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Compare FastAPI's lifespan context manager with legacy on_event hooks. Learn how to safely initialize DB pools and shared resources using app.state for better testability and ASGI compliance.
Spyder's Variable Explorer turns the IPython kernel namespace into a live, editable table with lazy loading, bidirectional sync, and built-in plotting—making interactive data inspection faster than print statements for scientific Python workflows.
uWSGI's built-in Spooler offloads long-running tasks from HTTP workers using a file-based queue — no Redis, no extra services. This post covers configuration, a worked PDF-generation example, and the operational trade-offs versus Celery/RQ.
Stop relying on loose version constraints. Learn how Poetry's deterministic resolver and lockfiles eliminate environment drift and ensure reproducible Python builds.
Stop letting network latency freeze your Python apps. Learn how to use asyncio and aiohttp to handle concurrent I/O-bound tasks and increase application throughput.
Stop relying solely on connection counts to find influential nodes. Learn how to use Degree, Betweenness, and PageRank in NetworkX to identify hubs, bottlenecks, and authorities.
Learn how to define and use Poetry dependency groups to keep development, testing, and production packages isolated and reproducible.
Learn how to use Plotly's layout.template to eliminate redundant styling code and instantly switch between themes like plotly_dark and ggplot2 for consistent visualizations.
Learn how to diagnose and fix 'ValueError: operands could not be broadcast together' in NumPy using shape inspection, np.newaxis, and alignment strategies.