simple flask hello world

  1. Import the Flask class from the flask module.
  2. Create an instance of the Flask class. The first argument is the name of the application’s module or package. If you are using a single module, use name.
  3. Use the route() decorator to tell Flask what URL should trigger the function. The function is given a URL, and it returns the output that should be shown in the user's browser.
  4. Define a function, in this case, hello_world(), which will be called when the specified URL is requested.
  5. Use the run() function to run the application on the local development server. Set debug=True to enable debug mode, allowing the server to reload itself on code changes and provide a helpful debugger.