mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
csrftoken() now works with .render_template(), closes #863
This commit is contained in:
parent
eed116ac05
commit
28bb1c5189
4 changed files with 19 additions and 1 deletions
|
|
@ -182,11 +182,17 @@ def register_routes():
|
|||
else:
|
||||
return Response.json(await request.post_vars())
|
||||
|
||||
async def csrftoken_form(request, datasette):
|
||||
return Response.html(
|
||||
await datasette.render_template("csrftoken_form.html", request=request)
|
||||
)
|
||||
|
||||
return [
|
||||
(r"/one/$", one),
|
||||
(r"/two/(?P<name>.*)$", two),
|
||||
(r"/three/$", three),
|
||||
(r"/post/$", post),
|
||||
(r"/csrftoken-form/$", csrftoken_form),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue