Forbidden (CSRF token missing or incorrect.): /ueditor/controller/
[27/Jun/2017 23:49:25] "POST /ueditor/controller/?imagePathFormat=courses%2Fueditor%2F&filePathFormat=courses%2Fueditor%2F&action=uploadvideo&encode=utf-8 HTTP/1.1" 403 2266

  错误原因:get_ueditor_controller() 方法没有csrf保护

  解决办法:

  在ueditor源码中的views.py文件中找到get_ueditor_controller函数,然后添加@csrf_exempt 装饰器

@csrf_exempt
def get_ueditor_controller(request):
    """获取ueditor的后端URL地址    """

    action=request.GET.get("action","")
    reponseAction={
        "config":get_ueditor_settings,
        "uploadimage":UploadFile,
        "uploadscrawl":UploadFile,
        "uploadvideo":UploadFile,
        "uploadfile":UploadFile,
        "catchimage":catcher_remote_image,
        "listimage":list_files,
        "listfile":list_files
    }
    return reponseAction[action](request)

 

相关文章:

  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2021-10-26
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-23
  • 2022-01-23
  • 2021-08-10
  • 2021-04-05
  • 2021-08-10
相关资源
相似解决方案