最新版本的 Django Template Language

2010-07-20 18:10:41 +08:00
 Livid
http://docs.djangoproject.com/en/dev/ref/templates/builtins/

if 居然已经支持比较符了,可惜 App Engine 集成的那个版本还是很弱。

有可能把 latest 的 Django Template 弄到 App Engine 上么?
5759 次点击
所在节点    Python
4 条回复
c
2010-07-20 18:25:41 +08:00
c
2010-07-20 18:26:32 +08:00
@Livid 我想写 V2EX 的Django 版本
Livid
2010-07-20 18:32:16 +08:00
Configuring the template system in standalone mode

This section is only of interest to people trying to use the template system as an output component in another application. If you're using the template system as part of a Django application, nothing here applies to you.

Normally, Django will load all the configuration information it needs from its own default configuration file, combined with the settings in the module given in the DJANGO_SETTINGS_MODULE environment variable. But if you're using the template system independently of the rest of Django, the environment variable approach isn't very convenient, because you probably want to configure the template system in line with the rest of your application rather than dealing with settings files and pointing to them via environment variables.

To solve this problem, you need to use the manual configuration option described in Using settings without setting DJANGO_SETTINGS_MODULE. Simply import the appropriate pieces of the templating system and then, before you call any of the templating functions, call django.conf.settings.configure() with any settings you wish to specify. You might want to consider setting at least TEMPLATE_DIRS (if you're going to use template loaders), DEFAULT_CHARSET (although the default of utf-8 is probably fine) and TEMPLATE_DEBUG. All available settings are described in the settings documentation, and any setting starting with TEMPLATE_ is of obvious interest.
blabber2008
2010-09-09 12:01:45 +08:00
@c 开源不

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/723

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX