Chinaunix首页 | 论坛 | 博客
  • 博客访问: 34552
  • 博文数量: 9
  • 博客积分: 225
  • 博客等级: 二等列兵
  • 技术积分: 110
  • 用 户 组: 普通用户
  • 注册时间: 2012-12-06 16:45
个人简介

木有

文章分类
文章存档

2013年(4)

2012年(5)

我的朋友

分类: 系统运维

2012-12-21 10:14:12

此blog意在记录解决学习开发中遇到的问题,您看到这篇blog可能意味着您也遇见类似问题,如果这篇文章对您没有帮助,能否请您在留言中说下您的问题,不胜感激。

TypeError at /testnetwork/ pop expected at least 1 arguments, got 0
Request Method: GET
Request URL:
Django Version: 1.4
Exception Type: TypeError
Exception Value: pop expected at least 1 arguments, got 0




  1. form = HostForm()
  2. form.fields['ips_ranges'].choices = RANGE_CHOICE
  3. form.fields['ranges_subnet'].choices = SUBNET_CHOICE
  4. form.fields['subnet_network'].choices = NETWORK_CHOICE
  5. 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)


阅读(7916) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~