0
0
DBDiksha Bhrigue
def main():
app = Flask("My app")
render_template("main.html")
request.url("/")
return app.run()
When you run this code, Flask will create a new instance of your app, call the main() function in that app, and finally tell the browser to go to http://localhost:5000/ .
In this code, we define a main() function that will do the following:
Create an instance of our app
Call the render_template() function to render the template defined in main.html
Call the request.url() function to set the url for the app. This will be the root page of our app.
Return the app.run() function to the calling code.
from flask import Flask, render_template, request