Django显示 MultiValueDictKeyError at /myDetector/


我试过很多办法了 都没法解决 各位大哥们

帮忙看看

代码见下

mainDealer()函数

def mainDealer(request):


# post = request.POST.items()

print("rawTarget =", request.POST["rawTarget"])

target = reverse("myDetector:tempTest") + '?'

argName = request.POST["paramName"]

argPath = argName.split("?")[0]

argName = argName.split("?")[1]

# dealt by model

lmModel = Judger.readModelFromFile(name=Judger.getFileName(

    argName, "2018119", "lm"), obj_hook=Judger.lmFromFile)

cmModel = Judger.readModelFromFile(name=Judger.getFileName(

    argName, "2018119", "cm"), obj_hook=Judger.cmFromFile)

lmPredictRst = lmModel.predict(

    samples=[

        request.POST["paramValue"]],

    realRst=[])

cmPredictRst = cmModel.predict(

    samples=[

        request.POST["paramValue"]],

    realRst=[])

judgeRst = {"lm": lmPredictRst[0], "cm": cmPredictRst[0]}

if not judgeRst["lm"]:

    addNewMarkedValue(argName, request.POST["paramValue"], "lm", argPath)

if not judgeRst["cm"]:

    addNewMarkedValue(argName, request.POST["paramValue"], "cm", argPath)

#


问题描述

MultiValueDictKeyError at /myDetector/

"'rawTarget'"

Request Method:

GET

Request URL:

http://localhost:8000/myDetector/

Django Version:

1.11.7

Exception Type:

MultiValueDictKeyError

Exception Value:

"'rawTarget'"

Exception Location:

D:ProjecttestSitevenvlibsite-packagesdjangoutilsdatastructures.py in __getitem__, line 85

Python Executable:

D:ProjecttestSitevenvScriptspython.exe

Python Version:

3.6.2

Python Path:

['D:\Project\malicoiusWebParamJudger\testSite',

'D:\Project\testSite\venv\Scripts\python36.zip',

'D:\Python\Python36\DLLs',

'D:\Python\Python36\lib',

'D:\Python\Python36',

'D:\Project\testSite\venv',


Server time:

Fri, 17 May 2019 09:58:33 +0800


问题出现的环境背景及自己尝试过哪些方法

尝试使用request.post.get() 但是没有用


达令说
浏览 2153回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP