Language

Flask (Reference) · Lesson 42 of 56

Flask App Basics

Source: 13-Flask/flask/app.py

Start here — no coding background needed

What you will learn

Routes map URLs to Python functions.

In simple words

Visiting `/hello` runs a function that returns "Hello".

Build websites with Python — read for overview; run full apps on your computer later.

Easy example — try this first

Easy example — run this first. Change values and press Run again.

Python

Runs in your browser via Pyodide — no server. First run may take a few seconds.

Reference notes (from full bootcamp)

Optional — deeper detail for when you are ready

Reference script from the bootcamp repo. Read the code below; run a simplified version in the playground when marked runnable.

Example HCL
HCL
from flask import Flask
'''
 It creates an instance of the Flask class, 
 which will be your WSGI (Web Server Gateway Interface) application.
'''
###WSGI Application
app=Flask(__name__)

@app.route("/")
def welcome():
    return "Welcome to this best Flask course.This should be an amazing course"

@app.route("/index")
def index():
    return "Welcome to the index page"


if __name__=="__main__":
    app.run(debug=True)

Browser practice only — full example needs Python on your computer (files, Flask, threads, etc.).

Practice test — try yourself

Write code, press Check. Wrong answer shows the correct code to copy & run.

You learned "Flask App Basics". Use print() to show: Done: Flask App Basics

Hint: Use one print() with the exact text.

Python