What's New in Flask 2.0?
- Supports async views and other callbacks such as error handlers, defined with async def. However, ASGI features such as web sockets are not supported at present.
- Blueprints can be nested under other blueprints, allowing a more layered approach to organizing the application.
- Add route decorators for common HTTP API methods. For example, @app.post("/login") is a shortcut for @app.route("/login", methods=["POST"]).
- Better CLI errors when an app could not be loaded. Running the development server shows errors immediately, they are only deferred on reloads.
- A new Config.from_file function to load config from any file format.
- The flask shell command enables tab completion like the regular python shell does.
- When serving static files, browsers will cache based on content rather than a 12 hour timer. This means changes to static content such as CSS styles will be reflected immediately on reload without needing to clear the cache.