Spaces:
Sleeping
Sleeping
async def index(request: Request): | |
print('Request for index page received') | |
return templates.TemplateResponse('index.html', {"request": request}) | |
async def hello(request: Request, name: str = Form(...)): | |
if name: | |
print('Request for hello page received with name=%s' % name) | |
return templates.TemplateResponse('hello.html', {"request": request, 'name':name}) | |
else: | |
print('Request for hello page received with no name or blank name -- redirecting') | |
return RedirectResponse(request.url_for("index"), status_code=status.HTTP_302_FOUND) | |