Ticket #5125: 5125.diff

File 5125.diff, 1.4 KB (added by ubernostrum, 8 years ago)

New patch, hopefully clear explanation

  • docs/templates.txt

     
    77you have any exposure to other text-based template languages, such as Smarty_
    88or CheetahTemplate_, you should feel right at home with Django's templates.
    99
     10.. admonition:: Philosophy
     11
     12    If you have a background in programming, or if you're used to
     13    languages like PHP which mix programming code directly into
     14    HTML, you'll want to bear in mind that the Django template system
     15    is not simply Python embedded into HTML. This is by design: the
     16    template system is meant to express presentation, not program
     17    logic.
     18   
     19    The Django template system does provide tags which function
     20    similarly to some programming constructs -- an ``{% if %}`` tag
     21    for boolean tests, a ``{% for %}`` tag for looping, etc. -- but
     22    these are not simply executed as the corresponding Python code,
     23    and the template system will not execute arbitrary Python
     24    expressions; only the tags, filters and syntax listed below are
     25    supported by default (though you can add `your own extensions`_ to
     26    the template language as needed).
     27
    1028.. _Smarty: http://smarty.php.net/
    1129.. _CheetahTemplate: http://www.cheetahtemplate.org/
     30.. _your own extensions: ../templates_python/#extending-the-template-system
    1231
    1332Templates
    1433=========
Back to Top