Lazo Lab Sign up

Python Projects & Skills / The web and automation

Lesson 21 of 28

Building a website with Flask

Flask is a small Python web framework. A route connects a URL to a function that returns a page. Lazo Lab itself is built with Flask.

Key points

  • @app.route('/') maps a URL
  • render_template for HTML pages
  • Never run debug mode in production
from flask import Flask
app = Flask(__name__)

@app.route("/")
def home():
    return "Hello from Flask"
Watch a video on thisOpens YouTube search results for “Building a website with Flask” in a new tab

Quiz · +10 XP

What does @app.route('/') do in Flask?

Log in to save progress and earn XP.