Python 网页模板引擎
我正在寻找一个Python Web 模板引擎,其工作原理如下:
<table>
<%
for item in items:
%>
<tr>
<th>Name</th>
<td><%= item.name %></td>
</tr>
<%
%>
</table>
我以前使用过PHP,所以这对我来说似乎很好。我看过这里 http://wiki.python.org/moin/Templated 但我找不到正是我正在寻找的
I am looking for a python web templating engine that works like this:
<table>
<%
for item in items:
%>
<tr>
<th>Name</th>
<td><%= item.name %></td>
</tr>
<%
%>
</table>
I have worked with PHP before so this seems nice to me. I have looked here http://wiki.python.org/moin/Templating but I cant find exactly what Im looking for
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Jinja2 — 受 Django 模板启发,但经过很大改进,基于文本。说到 Django,您可能想在选择模板引擎之前选择一个框架。
Jinja2 — inspired by Django templates, but much improved, text-based. And speaking of Django, you probably want to pick a framework before you pick a template engine.
我会尝试 Mako
I would try Mako
它不仅仅是一个模板引擎......但我是 Django 的超级粉丝
https://djangoproject.com/" rel="nofollow">https:// /djangoproject.com/
https://docs.djangoproject.com/en/1.3/topics/templates/
It's a lot more than just a template engine... But I'm a huge Django fan
https://djangoproject.com/
https://docs.djangoproject.com/en/1.3/topics/templates/
您很可能正在寻找 Jinja,http://jinja.pocoo.org/docs/
另外,您可能想熟悉 Web2Py、Flask 或 Django。
You're most probably looking for Jinja, http://jinja.pocoo.org/docs/
Also, you might want to familiarise yourself with Web2Py, Flask or Django.