Apache Web服务器上的Django“ dict”对象没有属性“ render_context”

| 我有一个问题,我将Django项目上传到运行apache,mod_python和django的网络服务器。在我开发的计算机上,以下工作正常
nameBox = getNamesBox().render(locals())
--
def getNamesBox():
    users = User.objects.filter()

    templateString = \'<select name=\"name box\">\'
    for user in users:
        templateString += \'<option value=\"\' + user.name + \'\"> \' + user.name + \'</option>\'

    templateString += \'</select>\'

    template = Template(templateString)

    return template
但是在Web服务器上,从apache或manage.py runserver运行时,它说
AttributeError at /order_site/order/
\'dict\' object has no attribute \'render_context\'
两台机器上的代码是相同的,所以我觉得可能还有其他问题?它无法呈现我的表单,我也不知道为什么。     
已邀请:
        
Template
上的
render()
方法将
Context
对象作为其自变量,而不是字典。您必须根据字典来构建一个
Context
对象,例如
namedbox = getNamesBox().render(Context(locals()))
    

要回复问题请先登录注册