web services in python we then need to create the main application object which is an instance of the flask classfrom flask import flaskjsonify app flask(__name__the argument passed into the flask(constructor is the name of the application' module or package as this is simple example we will use the __name__ attribute of the module which in this case will be '__main__in larger more complex applicationswith multiple packages and modulesthen you may need to choose an appropriate package name the flask application object implements the wsgi (web server gateway interfacestandard for python this was originally specified in pep- in and was updated for python in pep- published in it provides simple convention for how web servers should handle requests to applications the flask application object is the element that can route request for url to python function providing routing information we can now define routing information for the flask application object this information will map url to function when that url isfor exampleentered into web browsers url fieldthen the flask application object will receive that request and invoke the appropriate function to provide route mapping information we use the @app route decorator on function or method for examplein the following code the @app route decorator maps the url /hello to the function welcome(for http get requests@app route('/hello'methods=['get']def welcome()return jsonify({'msg''hello flask world'}there are two things to note about this function definitionthe @app route decorator is used to declaratively specify the routing information for the function this means that the url '/hellowill be mapped to the function welcome(the decorator also specifies the http method that is supportedin this case get requests are supported (which is actually the default so it does not need to be included here but is useful from documentation point of view