Cursor Rules for
Flask

This rule explains Flask conventions and best practices for lightweight Python web applications.
Back to rules
Type
Backend
Language(s)
Python
Stats
32 views
3 copies
1 download
flask.mdc
---
description: This rule explains Flask conventions and best practices for lightweight Python web applications.
globs: *.py
alwaysApply: false
---

# Flask rules

- Use Blueprints to organize routes by feature or resource
- Use Flask-SQLAlchemy for database models and ORM
- Use application factories for flexible application initialization
- Use Flask extensions for common functionality (Flask-Login, Flask-WTF, etc.)
- Store configuration in environment variables
- Use Flask-Migrate for database migrations
- Implement proper error handling with error handlers
- Use Flask-RESTful or similar for building APIs