Skip to content

Instantly share code, notes, and snippets.

@nedimcanulusoy
Created February 7, 2022 14:16
Show Gist options
  • Select an option

  • Save nedimcanulusoy/f1f64030876eb8bdc08e92917c6ce426 to your computer and use it in GitHub Desktop.

Select an option

Save nedimcanulusoy/f1f64030876eb8bdc08e92917c6ce426 to your computer and use it in GitHub Desktop.
Create a route by Flask
from flask import Flask, render_template
app = Flask(__name__) #imports name of the place the app is defined
@app.route('/') #the route that we want to access
def home(): #the function for the given route
return render_template('index.html') #generates output from index.html file
if __name__ == '__main__':
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment