Django template and the locals trick

后端 未结 8 1430
不思量自难忘°
不思量自难忘° 2020-12-02 10:43

The django books gives the local trick in order to avoid to type a long list of parameters as context dictionnary

http://www.djangobook.com/en/2.0/chapter04/

8条回答
  •  猫巷女王i
    2020-12-02 11:14

    I don't like it, personally. There's probably no reason for my preference, other than the old Python dictum "Explicit is better than implicit". I like to know exactly what's going into my templates.

提交回复
热议问题