Closed josejachuf closed 3 years ago
@josejachuf since 2.0 the default content-type
is text/plain
instead of text/html
(ref: https://emmett.sh/docs/2.2.x/upgrading#version-20).
While App.route
hides this when using standard template flow, whenever you manually generate string responses containing different content, you should manually set the content-type header value, eg:
@app.on_error(404)
async def not_found():
response.content_type = "text/html"
return app.render_template("404.html")
I had read it a while ago in the documentation, now I remember it. This works fine Thank you
Hi @gi0baro In reference to [1]. I see that it does not render on the browser but shows the code of the page in browser
test.html is:
[1] https://github.com/emmett-framework/emmett/issues/318