我使用的是特伦博格,一个WYSIWYG JavaScript编辑器,它具有从粘贴的URL呈现图像的功能。它还有一个上传插件,它允许上传本地图像和自定义服务器端处理。
我的python/django函数upload_image()可以成功地检测上传的图像--但是当我使用URL图像输入时,我的python函数无法检测它。Trumbowyg只是简单地呈现图像,而没有遍历我的python后端。
这是我的密码:
$('#id_content').trumbowyg({
btnsDef: {
// Create a new dropdown
image: {
dropdown: ['insertImage', 'upload'],
ico: 'insertImage'
}
},
// Redefine the button pane
btns: [
['strong', 'em', 'del'],
['link'],
['image'], // Our fresh created dropdown
],
plugins: {
// Add imagur parameters to upload plugin for demo purposes
upload: {
serverPath: '/upload_image/',
fileFieldName: 'content_image',
urlPropertyName: 'url'
}
}
});def upload_image(request):
print('Success') #only prints when I use the upload input, not the URL input为什么可以在检测上传的图像而不是URL输入?
https://stackoverflow.com/questions/51165569
复制相似问题