audrey.feldroy.com

The experimental notebooks of Audrey M. Roy Greenfeld. This website and all its notebooks are open-source at github.com/audreyfeldroy/audrey.feldroy.com


# FastHTML by Example

by Audrey M. Roy Greenfeld | Mon, Jul 29, 2024

Studying https://docs.fastht.ml/tutorials/by_example.html more


from fasthtml.common import *
app = FastHTML()
@app.get("/")
def home():
    return Div(H1('Hello, World'), P('Some text'), P('Some more text'))
from starlette.testclient import TestClient
client = TestClient(app)
r = client.get("/")
r.text

Forms

Form(Input(type="text", name="data"),
                     Button("Submit"),
                     action="/", method="post")

© 2024-2025 Audrey M. Roy Greenfeld