Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Introduction to Flask Web Frame | Python Fundamentals lesson | BraveProgrammer
  1. Courses
  2. /
  3. Python Fundamentals

Lesson 46 of 55

·Python

Introduction to Flask Web Framework

20 minutes

Course progress84%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • `Flask(__name__)` creates the application object.
  • Define routes with `@app.route('/path')` decorators.
  • `app.run()` starts the built‑in development server.
  • Extensions (Flask‑SQLAlchemy, Flask‑Login, etc.) add common functionality.

Introduction to Flask Web Framework

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.

Make it stickPractice what you've learned1 quiz · 5 practical tests · Optional activities from Python FundamentalsBrowse activities
Previous lessonBuilding a CLI with argparseContinue to lesson 47Building a Simple REST APIBack to Python Fundamentals curriculum