Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django—类型为'的参数;WSGIRequest&x27;这是不可容忍的_Django_Django Forms - Fatal编程技术网

Django—类型为'的参数;WSGIRequest&x27;这是不可容忍的

Django—类型为'的参数;WSGIRequest&x27;这是不可容忍的,django,django-forms,Django,Django Forms,在使用表单时,如何修复以下Django错误 TypeError at /url/ argument of type 'WSGIRequest' is not iterable 在调试代码约45分钟后,我发现需要以下行来传递已发布信息的请求字典,而不是请求本身: # This: # job_form = JobForm(request) # Should Be: job_form = JobForm(request.GET) # OR job_form = JobForm(reques

在使用表单时,如何修复以下Django错误

TypeError at /url/
argument of type 'WSGIRequest' is not iterable

在调试代码约45分钟后,我发现需要以下行来传递已发布信息的请求字典,而不是请求本身:

# This: 
#    job_form = JobForm(request)
# Should Be: 
job_form = JobForm(request.GET) # OR
job_form = JobForm(request.POST)
最初在谷歌上找不到任何东西。希望这对别人有帮助