Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render jinja2 templates in async mode #628

Closed
simonw opened this issue Nov 12, 2019 · 2 comments
Closed

Render jinja2 templates in async mode #628

simonw opened this issue Nov 12, 2019 · 2 comments
Labels

Comments

@simonw
Copy link
Owner

@simonw simonw commented Nov 12, 2019

I started playing with this in #404 and got good results but it didn't work in Python 3.5. As of #627 I don't support 3.5 any more so this can go ahead.

Rendering templates in async mode will mean that template plugins can include async code... which opens the door to custom template functions that execute SQL queries!

@simonw

This comment has been minimized.

Copy link
Owner Author

@simonw simonw commented Nov 14, 2019

This is going to be a lot easier than the first attempt because I already modified the .render() method to be async four months ago: fcfcae2#diff-4296b31822a931646fa92cd2d5581521R105

simonw added a commit that referenced this issue Nov 14, 2019
@simonw simonw closed this in 8c642f0 Nov 14, 2019
@simonw

This comment has been minimized.

Copy link
Owner Author

@simonw simonw commented Nov 14, 2019

I'm releasing this as Datasette 0.32 - I have a new plugin which takes advantage of it here: https://github.com/simonw/datasette-template-sql

simonw added a commit that referenced this issue Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.