Lesson 46 of 55
PythonIntroduction to Flask Web Framework
20 minutes
Course progress84%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 46 of 55
Python20 minutes
Keep these ideas in mind as you work through the lesson.
Flask is a lightweight, extensible web framework that lets you spin up a web server with just a few lines of code.
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from Flask!'
if __name__ == '__main__':
app.run(debug=True)
Run the script and open http://127.0.0.1:5000/ in your browser. The debug=True flag enables hot‑reloading and an interactive debugger.