Detailed flask in route

  flask is a lightweight web development framework that decorator route function everywhere, url is used to view and matching functions. Call routing function route in two ways: static and dynamic path path

Mode 1: @ app.route ( "url") is a static url path

Format @ app.routeI ( "url")

def func():

  pass

Embodiment 2: using <> passed dynamically the url, @ app.route ( "/ <rulwhere the path indeterminate. If desired path special format may be used to limit the converter. See flask of six basic converter.

Format @ app.routeI ( "/ <url>")

FUNC DEF ( URL ): # dynamic url, parameters must view function

  pass

 

Guess you like

Origin www.cnblogs.com/xuehaiwuya0000/p/11096328.html