I hope someone can help out with this one. I have been using djangocms to build a simple frontend centric website for a client so they can maintain their own content. There is nothing fancy in this setup. Just a few template.html files, a little css and djangocms to pull it all together. There are no other forms, models, views or anything at this stage. Just pure djangocms.

最初我使用的是 django 1.8.6,图像选择器似乎工作正常。我可以上传我的文件,每个文件旁边都有一个可以使用的选择器图标,一切都很棒。见下图。这是使用 cmsplugin-filer。

在此处输入图像描述

然后我尝试将网站升级到 Django 1.11.13 版本,我开始遇到这个问题。您在上面看到的文件选择不再对用户可用。我花了几天时间研究这个,在我的旅行中我发现 cmsplugin-filer 显然现在已被弃用。所以我删除了它并切换到推荐的 djangocms-filer 安装,认为这可能会解决我的问题......但没有。经过许多小时的摸索,我想这一定是我项目中的某些东西把东西扔掉了,所以我使用规定的 djangocms-installer 完成了 100% 的全新安装。除了将它连接到 postgresql 数据库之外,它是一个完全普通的安装,但它仍然无法正常工作。我得到的只是下图。一个简单的复选框,但无法选择图像,也无法保存我选择的内容。

在此处输入图像描述

Below is a snapshot of my pip freeze showing everything installed in my virtualenv and the associated versions.

在此处输入图像描述

My settings file is almost 100% standard so I don't understand why I can't get this to work. Note: If, when I am adding the plugin to my template, I don't select the Choose File Button but simply drag an image into the grey rectangle, it all works fine. My file gets uploaded into the unsorted uploads folder and the image is selected into my template all in one go, but using the choose file route, where I have more control over my files and how they are stored, doesn't.

Does anyone have any idea what I might be missing please?

UPDATE: 在此处输入图像描述


Django CMS 覆盖了一些静态文件,并且浏览器缓存中有一些旧文件。您需要清除缓存或使用隐身窗口打开页面。


选择图像时会发生什么?它只是打开图像的更改表单吗?我敢肯定,当我尝试使用文件管理器时,我发现在上传图像后我无法选择它们以将它们包含在任何内容中,我只是不断收到更改表格。

嗨,马克,我刚看到 Django Admin 文件管理器类型窗口,我可以在其中查看我的所有图像并上传更多图像、创建文件夹等。我什至可以勾选图像旁边的框,但我无法发送选择返回页面。右下角有一个取消按钮,但没有保存或继续按钮或类似的东西。请参阅上面发布的新图片。

今天我也遇到了同样的问题,你找到解决办法了吗@cander

嘿 Alleo,不,我没有。我暂时搁置了这个问题,当我回来处理它时,一切正常。可能在某个地方有一些更新,但由于我已经将它停放了几个月,所以我无法就解决方案是什么给你一个明确的答案。对不起。