Lesson 46 of 55 · Python
Introduction to Flask Web Framework
Duration: 20 minutes
Introduction to Flask Web Framework\n\nFlask is a lightweight, extensible web framework that lets you spin up a web server with just a few lines of code.\n\n```python\nfrom flask import Flask\n\napp = Flask(name)\n\n@app.route('/')\ndef index():\n return 'Hello from Flask!'
\nif name == 'main':\n app.run(debug=True)\n```\n\nRun the script and open http://127.0.0.1:5000/ in your browser. The debug=True flag enables hot‑reloading and an interactive debugger.\n