What's New in Flask 2.0?

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.

 

要查看或添加评论,请登录

Lekshmi R的更多文章

  • E-Accessibility: Choosing colors wisely

    E-Accessibility: Choosing colors wisely

    There's a lot of buzz around 'E-Accessibility'. Have you ever checked if the applications you develop are accessible?…

社区洞察

其他会员也浏览了