为什么显示“禁止错误”?

2024-10-01 02:31:59 发布

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

我试图在我正在做的一个项目的网站上添加拖放功能,但是我得到了这个错误。它可能是因为this产生的,但我不知道这是否是原因。在

我的页面使用Django和python运行。在

用python编写的“fileupload”后面的函数似乎根本没有调用。我怎样才能纠正那个被禁止的错误?在

拜托,你想问我什么都行。在

错误如下所示

POST http://127.0.0.1:8008/file-upload 403 (FORBIDDEN) jquery.js:9631
send jquery.js:9631
jQuery.extend.ajax jquery.js:9176
send jquery.fileupload.js:880
$.widget._onSend jquery.fileupload.js:942
(anonymous function) jqui.js:6
data.submit jquery.fileupload.js:648
(anonymous function) jquery.fileupload.js:193
fire jquery.js:3119
self.add jquery.js:3165
$.widget.options.add jquery.fileupload.js:192
e.Widget._trigger jqui.js:6
(anonymous function) jquery.fileupload.js:1008
jQuery.extend.each jquery.js:383
$.widget._onAdd jquery.fileupload.js:1001
(anonymous function) jqui.js:6
(anonymous function) jquery.fileupload.js:1240
fire jquery.js:3119
self.add jquery.js:3165
promise.always jquery.js:3266
$.widget._onDrop jquery.fileupload.js:1233
(anonymous function) jqui.js:6
h jqui.js:6
jQuery.event.dispatch jquery.js:4641
elemData.handle

生成的jquery行如下所示:

^{pr2}$

我的观点如下:正如我所说,这个函数可能甚至没有被调用

def file_upload(request):
    # create a new plot if necessary and attach to session
    print "file upload"
    [.......]
    return HttpResponse(json.dumps(""),content_type="application/json")

而且,在我的网址.py公司名称:

urls.py:    url(r'^file-upload$', 'myproject.views.file_upload', name='file_upload'),

Tags: 函数sendadd错误jsfunctionwidgetjquery