Language

Flask (Reference) · Lesson 41 of 56

Flask Entry Point

Source: 13-Flask/flask/main.py

Start here — no coding background needed

What you will learn

See how a small web server starts — run full Flask on your laptop later.

In simple words

Flask listens for browser requests and returns HTML or JSON.

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,render_template
'''
 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 "<html><H1>Welcome to the flask course</H1></html>"

@app.route("/index")
def index():
    return render_template('index.html')

@app.route('/about')
def about():
    return render_template('about.html')


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 Entry Point". Use print() to show: Done: Flask Entry Point

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

Python