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