Py.Cafe

maartenbreddels/

fasthtml-hello-world

Fasthtml Interactive Hello World

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
try:
    from fasthtml.common import *

    app,rt = fast_app()

    @rt('/')
    def get(): return Div(P('Hello World!'), hx_get="/change")

    # serve()
    app.starlette_app = app
except Exception as e:
    print(e)
    import traceback
    traceback.print_exception(e)