Support non-async view functions, closes #867

This commit is contained in:
Simon Willison 2020-06-27 11:30:34 -07:00
commit 4b142862f2
4 changed files with 33 additions and 10 deletions

View file

@ -187,12 +187,16 @@ def register_routes():
await datasette.render_template("csrftoken_form.html", request=request)
)
def not_async():
return Response.html("This was not async")
return [
(r"/one/$", one),
(r"/two/(?P<name>.*)$", two),
(r"/three/$", three),
(r"/post/$", post),
(r"/csrftoken-form/$", csrftoken_form),
(r"/not-async/$", not_async),
]