初始设置后Dajaxice函数不可调用错误

2024-09-30 08:37:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚刚设置了Django和Dajaxice,在仔细检查了Django-set和Dajaxice的文档之后,我很难让它正常工作。在

在对堆栈溢出进行了一些研究之后,我唯一发现的就是确保我的网址.py,我知道。这是我的py.ajax版在我的时间里,我要做的是:

from django.utils import simplejson
from dajaxice.decorators import dajaxice_register


@dajaxice_register
def sayhello(request):
return simplejson.dumps({'message':'Hello World'})

和我的html页面

^{pr2}$

我得到的错误是

FunctionNotCallableError at /dajaxice/TimeBlendApp.sayhello/
TimeBlendApp.sayhello
Request Method: GET
Request URL:    http://127.0.0.1:8000/dajaxice/TimeBlendApp.sayhello/
Django Version: 1.5.1
Exception Type: FunctionNotCallableError
Exception Value:    
TimeBlendApp.sayhello
Exception Location: C:\Python27\lib\site-packages\dajaxice\views.py in dispatch, line  60

Tags: djangofrompyimportregisterrequestexceptionsayhello

热门问题