模板语言

1.什么是模板语言?
----html+逻辑控制语句

2.进入Django命令行命令: python manage.py shell(这就进入了此Django项目的环境)


3.Django模板语法:

D:pycharm_filemysite>python manage.py shell
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)

>>> from django.template import Context,Template
>>> t=Template('your name is{{name}}')
>>> c=Context({"name":"star"})

>>> t.render(c)

'your name isstar'
 4.Template模板对象可以重复使用
5.Django模板解析速度非常快捷
原文地址:https://www.cnblogs.com/startl/p/12366445.html