Is it possible to render handlebar templates with Django? I am trying to avoid providing two copies of each template that needs to be rendered both server-side and client-side.
是否可以使用Django渲染车把模板?我试图避免提供需要在服务器端和客户端呈现的每个模板的两个副本。
2 个解决方案
#2
0
I've created a custom tag that solves this problem. It iterates through the parser and ignores the handlebars expressions when sandwiched in between {% handlebars %} and {% endhandlebars %}
我已经创建了一个解决此问题的自定义标记。迭代解析器并在夹在{%handlebars%}和{%endhandlebars%}之间时忽略把手表达式
Check it out: https://github.com/anthonysutardja/Django-Template-Handlebars
看看:https://github.com/anthonysutardja/Django-Template-Handlebars
#1
#2
0
I've created a custom tag that solves this problem. It iterates through the parser and ignores the handlebars expressions when sandwiched in between {% handlebars %} and {% endhandlebars %}
我已经创建了一个解决此问题的自定义标记。迭代解析器并在夹在{%handlebars%}和{%endhandlebars%}之间时忽略把手表达式
Check it out: https://github.com/anthonysutardja/Django-Template-Handlebars
看看:https://github.com/anthonysutardja/Django-Template-Handlebars