fastapi-with-liveview/about_us.py

20 lines
500 B
Python
Raw Normal View History

2024-06-18 14:50:41 +02:00
from datetime import datetime
async def send_page(websocket, templates, data_frontend):
await websocket.send_json(
{
'selector': '#main',
'html': templates.get_template(
f'pages/about_us.html'
).render(),
}
)
async def current_time(websocket, templates, data_frontend):
await websocket.send_json(
{
'selector': '#time',
'html': f"<datetime>{datetime.now()}</datetime>",
}
)