mdeditor支持图片粘贴上传 发表评论 3997 views CXX1.COM原创博客网 › 白石 › 哲学 › 技艺 › Django › mdeditor支持图片粘贴上传 ------------ # mdeditor 如何支持图片截屏粘贴上传? > 原博客地址 https://rumenz.com/rumenbiji/ ## 现在问题来了如何让 Django 支持因为在这个里面只做了其 php 的demo ## 一、 下载 js 文件 > 把下载好的文件放到如下文件夹下面 /root/python/env/djangoblog/lib/python3.6/site-packages/mdeditor/static/mdeditor/js > uploadImg.js 是我们要放的 ## 二、 配置 mdeditor > 找到/root/python/env/djangoblog/lib/python3.6/site-packages/mdeditor/templates 下面的 markdown.html > 找到最下面的地方添加 ```javascript onload: function () { console.log('onload', this); //this.fullscreen(); //this.unwatch(); //this.watch().fullscreen(); //this.setMarkdown("#PHP"); //this.width("100%"); //this.height(480); //this.resize("100%", 640); initPasteDragImg(this); //必须 } ``` # 现在markdown就支持图片粘贴上传了