refactor: render
This commit is contained in:
parent
1e301c04c0
commit
0af50c21ae
@ -33,7 +33,7 @@ def get_root(request: Request):
|
||||
if request.url.path != "/":
|
||||
raise HTTPException(status_code=404)
|
||||
|
||||
return renderTemplate("main.html")
|
||||
return render("main.html")
|
||||
|
||||
|
||||
@app.post("/detect/{strength}")
|
||||
@ -104,6 +104,5 @@ def get_models_for_detection_strength(strength: DetectionStrength):
|
||||
return ["db_resnet50", "vitstr_small"]
|
||||
|
||||
|
||||
def renderTemplate(template, context={}):
|
||||
template = env.get_template(template)
|
||||
return HTMLResponse(template.render(context))
|
||||
def render(template, context={}):
|
||||
return HTMLResponse(env.get_template(template).render(context))
|
||||
|
Loading…
x
Reference in New Issue
Block a user