V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Livid
V2EX  ›  Python

最新版本的 Django Template Language

  •  
  •   Livid · 2010-07-20 18:10:41 +08:00 · 5752 次点击
    这是一个创建于 5241 天前的主题,其中的信息可能已经有所发展或是发生改变。
    http://docs.djangoproject.com/en/dev/ref/templates/builtins/

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

    有可能把 latest 的 Django Template 弄到 App Engine 上么?
    4 条回复    1970-01-01 08:00:00 +08:00
    c
        1
    c  
       2010-07-20 18:25:41 +08:00
    c
        2
    c  
       2010-07-20 18:26:32 +08:00
    @Livid 我想写 V2EX 的Django 版本
    Livid
        3
    Livid  
    MOD
    OP
       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
        4
    blabber2008  
       2010-09-09 12:01:45 +08:00
    @c 开源不
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   913 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 21:23 · PVG 05:23 · LAX 13:23 · JFK 16:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.