此blog意在记录解决学习开发中遇到的问题,您看到这篇blog可能意味着您也遇见类似问题,如果这篇文章对您没有帮助,能否请您在留言中说下您的问题,不胜感激。
TypeError at /testnetwork/
pop expected at least 1 arguments, got 0
- form = HostForm()
- form.fields['ips_ranges'].choices = RANGE_CHOICE
- form.fields['ranges_subnet'].choices = SUBNET_CHOICE
- form.fields['subnet_network'].choices = NETWORK_CHOICE
- context['form']=form
return render_to_response('testnetwork.html', {'networks':networks},context)
问题所在:
passing in three parameters to render_to_response. The third one is expected to be an instance of Context (see https://docs.djangoproject.com/en/dev/topics/http/shortcuts/#django.shortcuts.render_to_response), but you're passing in a dictionary.
解决方法
-form = HostForm()
|-form.fields['ips_ranges'].choices = RANGE_CHOICE
|-form.fields['ranges_subnet'].choices = SUBNET_CHOICE
|-form.fields['subnet_network'].choices = NETWORK_CHOICE
|-context['form']=form
|-context['networks'] = networks
|-return render_to_response('testnetwork.html',context)
阅读(7925) | 评论(0) | 转发(0) |