This release will contain some new features such as some shorthand properties for the route, support async views, callbacks such as error handlers, and better CLI errors.
Flask 2.0 Upgradation and Installation
Install from PyPI with pip. For example, for Flask:
pip install -U Flask
Note: Flask 2.0 have dropped all support for Python 2 and 3.5, Now Python 3.6 is the minimum supported version.
Flask 2.0 Updates
Previously deprecated code has also been removed. Testing tools such as pytest enable showing deprecation warnings automatically and turn them into errors to see early what you may need to change in your project.
Over the next few weeks, the ecosystem around the projects will continue to update to improve compatibility as necessary. The team encourages you to use pip-compile and Dependabot to pin and control upgrades to your dependencies to avoid unexpected changes.
Support async views and error handlers
Support async views and other callbacks such as error handlers, defined with
async def. Regular sync views continue to work unchanged. ASGI features such as web sockets are not supported. We will continue exploring how to add more support for async.
Function to load config
Config.from_file function to load config from any file format.
Route decorators for common HTTP API methods
Add route decorators for common HTTP API methods. For example,
@app.post("/login") is a shortcut for
Better CLI errors
Better CLI errors when an app could not be loaded. Running the development server shows errors immediately, they are only deferred on reloads.
Enables tab completion
flask shell command enables tab completion like the regular python shell does.
Caching based on content
While serving static files, browsers will cache based on file content rather than a 12-hour timer. That means changes to static content such as CSS styles will be reflected immediately on reload without needing to clear the cache.
Blueprints can be nested under the other blueprints, allowing a more layered approach to organizing the application.
At Raptor IT Consultants, our goal is establishing a foundation for your business network that empowers its users to work efficiently, while leveraging technologies that save time and money, and offering scalable IT solutions that work with any business model. #raptoritnetwork