Blog
In-depth articles on AI agents, LLM engineering, servers, Python and software development.
This article introduces how to build a database-driven API using FastAPI + SQLAlchemy, suitable for beginners. Its core advantages lie in FastAPI's high performance, automatic API documentation, and c
Cross-origin issues occur when a frontend requests backend APIs from different domains, ports, or protocols, which are blocked by the browser's same-origin policy. By default, FastAPI does not handle
API error handling is crucial for system robustness and user experience, and FastAPI provides a concise and efficient error handling mechanism. The core of the article includes: ### 1. Necessity of
FastAPI, a high-performance Python web framework, offers a concise and efficient solution for file uploads. Installation requires `fastapi` and `uvicorn`. Single files are handled via `UploadFile`, wh
FastAPI is a modern, high-performance Python Web framework based on type hints, with automatic generation of Swagger UI and ReDoc documentation, and supports asynchronous operations. It is suitable fo
In FastAPI, two common approaches for state management are global variables and caching. Global variables are the simplest way to share state, usable directly in single-process environments but requir
FastAPI's Dependency Injection (DI) centralizes the management of repetitive logic (e.g., database connections), resulting in cleaner and more flexible code with reduced redundancy, making it easier t
FastAPI is a modern, high-performance Python web framework suitable for building APIs and beginner-friendly. It has five core advantages: First, high performance, based on Starlette and Pydantic, with
This article focuses on "lightweight" frameworks, comparing the core differences between FastAPI and Django. "Lightweight" refers to simple configuration, minimal code, a gentle learning curve, and fo
This article compares the Python web frameworks Flask and FastAPI, with the core content as follows: Flask, an established lightweight framework born in 2010, is renowned for its "flexibility". It