Patterns for Flask
Certain things are common enough that the chances are high you will findthem in most web applications. For example quite a lot of applicationsare using relational databases and user authentication. In that case,chances are they will open a database connection at the beginning of therequest and get the information of the currently logged in user. At theend of the request, the database connection is closed again.
There are more user contributed snippets and patterns in the FlaskSnippet Archives.
- Larger Applications
- Application Factories
- Application Dispatching
- Implementing API Exceptions
- Using URL Processors
- Deploying with Setuptools
- Deploying with Fabric
- Using SQLite 3 with Flask
- SQLAlchemy in Flask
- Uploading Files
- Caching
- View Decorators
- Form Validation with WTForms
- Template Inheritance
- Message Flashing
- AJAX with jQuery
- Custom Error Pages
- Lazily Loading Views
- MongoDB with MongoEngine
- Adding a favicon
- Streaming Contents
- Deferred Request Callbacks
- Adding HTTP Method Overrides
- Request Content Checksums
- Celery Background Tasks
- Subclassing Flask
- Single-Page Applications