Flask â Application - Tutorialspoint
www.tutorialspoint.com › flask › flask_applicationfrom flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World’ if __name__ == '__main__': app.run() Importing flask module in the project is mandatory. An object of Flask class is our WSGI application. Flask constructor takes the name of current module (__name__) as argument. The route() function of the Flask class is a decorator, which tells the application which URL should call the associated function. app.route(rule, options)
Flask App Routing - GeeksforGeeks
www.geeksforgeeks.org › flask-app-routingOct 27, 2021 · To bind a function to an URL path we use the app.route decorator. In the below example, we have implemented the above routing in the flask. main.py. main.py. from flask import Flask. app = Flask (__name__) @app.route ("/hello") def hello (): return "Hello, Welcome to GeeksForGeeks".
Application Setup — Flask Documentation (1.1.x)
flask.palletsprojects.com › en › 1app = Flask(__name__, instance_relative_config=True) creates the Flask instance. __name__ is the name of the current Python module. The app needs to know where it’s located to set up some paths, and __name__ is a convenient way to tell it that. instance_relative_config=True tells the app that configuration files are relative to the instance folder.