DjangoUeditor icon indicating copy to clipboard operation
DjangoUeditor copied to clipboard

上传图片出现问题!

Open inflation opened this issue 12 years ago • 2 comments

传图片会被CSRF 403 ,望能尽快解决

inflation avatar Oct 20 '12 14:10 inflation

补充一下,是admin管理页面被403,不知道能不能在admin页面中加入csrf验证

inflation avatar Oct 23 '12 06:10 inflation

这个问题可以有几种办法解决: 1、去修改ueditor的源码,这样子如果升级uedit升级就比较麻烦,而且还得去分析其源码,要怎么改都是个问题,不推荐。 2、将settings里面的CSRF中间件去掉,当然也就没有csrf保护了,也没有这个问题了。一般小应用也无所谓的 3、修改DjangoUedit的views.py,加上@csrf_exempt,类似这样:

from django.views.decorators.csrf import csrf_exempt

@csrf_exempt def UploadFile(request,uploadtype,uploadpath):

@csrf_exempt def RemoteCatchImage(request,imagepath):

发件人: Leonardo Hu 发送时间: 2012-10-23 14:53 收件人: zhangfisher/DjangoUeditor 主题: Re: [DjangoUeditor] 上传图片出现问题! (#2) 补充一下,是admin管理页面被403,不知道能不能在admin页面中加入csrf验证 — Reply to this email directly or view it on GitHub.

zhangfisher avatar Oct 23 '12 07:10 zhangfisher