Blog
In-depth articles on AI agents, LLM engineering, servers, Python and software development.
This article introduces the basic points of returning JSON and setting HTTP status codes when developing APIs with Flask. To return JSON, use the `jsonify` function instead of directly returning a Pyt
Flask is a lightweight Python Web framework centered on a "micro" design. It is flexible and supports rich extensions, making it suitable for both beginners and large-scale projects. Installation is r
This article introduces the method of database interaction in Flask using SQLAlchemy (an ORM tool). The core steps are as follows: First, install Flask and Flask-SQLAlchemy. For development environme
This tutorial introduces the complete process of building a personal blog with Flask. First, install Flask and its extensions (SQLAlchemy for ORM, Login for user authentication, WTF for form handling,
This article introduces session management in Flask, with the core being the implementation of user state maintenance through the `session` object. Session management enables the server to remember us
This article introduces the core knowledge points of handling forms in Flask using `Flask-WTF` (based on WTForms). First, forms rely on the `Flask-WTF` extension, which needs to be installed via `pip
Flask context processors address the repetition of manual parameter passing when multiple templates need to share information (such as navigation menus and current user details). By using the `@app.co
This article introduces the core usages of `jsonify` and `redirect` in Flask. `jsonify` is used to return JSON data for APIs, automatically setting `Content-Type: application/json`. It supports conver
Flask handles user request parameters through the `request` object, which must be imported from `flask` first. It mainly involves three scenarios: 1. **Query String (GET Parameters)**: Obtain paramete
This article introduces the management and optimization of static files (CSS, JS, images, etc.) in Flask. By default, static files are stored in the `static` folder at the root directory of the projec