-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Reload template on the fly #273
Comments
|
Since Askama templates get built into your application at compile time, you could probably use cargo watch to do something like this. |
|
Hi thanks, that is one solution. However, it is a bit slow to launch |
|
This is not possible. Templates are transpiled into Rust code which is compiled into the application binary. As such, you cannot really reload only the templates. I suppose it's possible to build your application in a way such that all template code is contained in a dynamically linked library, which you could theoretically hot-reload if any template code changes. But I would say this is well outside Askama's scope. It might be possible to use Tera for development and Askama for production -- I don't know how different the Tera and Askama syntaxes are, exactly. |
|
Thanks for the answers! |
|
If there are particular syntax-level incompatibilities, I'm open to having some alternative syntax be implemented as part of Askama (there is already some support for alternative template syntaxes). |
|
What I can see immediately is the following difference:
Are you talking about choosing different brackets in config? |
|
We could probably easily support Yes, the configuration for different brackets is built on top of a more-or-less general mechanism for parametrizing the parser. |
I think it would be good to set the stage for projects to do this. Hot reloading seems to be a bit of a dark art in Rust still but hopefully we can at some point do this. Development speed at the moment is a fraction of how you would do something in Python. |
Hi, thanks for providing jinja2 experience in rust!
Feature request:
I am missing a watch and auto template reload feature, which is useful when I am finished with rust backend and start with html/js part.
The handlebars counter-part has this feature
The text was updated successfully, but these errors were encountered: