Issue Rendering HTML from FastListTemplate

Hello,

I am writing a main.py file and using FastListTemplate and am unable to render the html of the template at http://127.0.0.1:8000/ using Uvicorn.

template = pn.template.FastListTemplate(
    title="Empty",
    theme="dark",
    sidebar=[
    ],
    main=[],
    accent_base_color="#000000",
    header_background="#000000",
    header_text_align="center",
)

:point_down: Part I need help with :point_down: (code i provided below doesnot work)

app = FastAPI()

@app.get("/")
async def root(request: Request):
    doc = template.template
    return HTMLResponse(content=doc.render())

My goal is when I use uvicorn main:app --reload
I should be able to see my dashboard/FastListTemplate at http://127.0.0.1:8000/

Thanks.

Followed the user guide Documentation and it worked.

1 Like