推荐学习书目
› 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
396.81D
544.24D
V2EX  ›  Python

最新版本的 Django Template Language

  •  
  •   Livid ·
    PRO
    · Jul 20, 2010 · 7228 views
    This topic created in 5911 days ago, the information mentioned may be changed or developed.
    http://docs.djangoproject.com/en/dev/ref/templates/builtins/

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

    有可能把 latest 的 Django Template 弄到 App Engine 上么?
    4 replies  •  1970-01-01 08:00:00 +08:00
    c
        1
    c  
       Jul 20, 2010
    c
        2
    c  
       Jul 20, 2010
    @Livid 我想写 V2EX 的Django 版本
    Livid
        3
    Livid  
    MOD
    OP
    PRO
       Jul 20, 2010
    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  
       Sep 9, 2010
    @c 开源不
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2635 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 105ms · UTC 02:25 · PVG 10:25 · LAX 19:25 · JFK 22:25
    ♥ Do have faith in what you're doing.