擅长:python、mysql、java
<p>是的!这很正常。模板中的此类错误会自动失败,这在Django中是意料之中的。</p>
<p>要正确呈现模板,请使用<code>render_to_response('your_template.html', {'h':h})</code>(如果上下文字典很大,还有一个讨厌的快捷方式<code>render_to_response('your_template.html', locals())</code>)</p>
<p>下面是一些示例说明:<a href="http://www.djangobook.com/en/beta/chapter04/" rel="nofollow noreferrer">http://www.djangobook.com/en/beta/chapter04/</a>(关于如何处理无效变量的部分)</p>