'title' is an invalid keyword argument for this function 是怎么回事?
def action(request):
title=request.POST.get('title','TITLE')#TITLE是默认值,获取前端的title里的值
content=request.POST.get('content','CONTENT')
models.A.objects.create(title=title,content=content)
a=models.A.objects.all()#返回主页
return render(request,'firstapp/index.html',{'key':a})
这是我在view.py里写的代码
TypeError at /index1/edit/action
'title' is an invalid keyword argument for this function
Request Method:
POST
Request URL:
http://localhost:8000/index1/edit/action
Django Version:
1.10.2
Exception Type:
TypeError
Exception Value:
'title' is an invalid keyword argument for this function
Exception Location:
E:\Python\lib\site-packages\django\db\models\base.py in __init__, line 555
Python Executable:
E:\Python\python.exe
Python Version:
3.4.4
Python Path:
['F:\\Djangoweb\\yjyblog',
'C:\\Windows\\system32\\python34.zip',
'E:\\Python\\DLLs',
'E:\\Python\\lib',
'E:\\Python',
'E:\\Python\\lib\\site-packages']
Server time:
星期一, 17 四月 2017 15:22:18 +0000
这是浏览器报错