django grappelli、文件浏览器和 Tiny MCE 插入图像对话框
所以,我找到了名为“grappelli”的 django 管理界面。看了截图并决定我喜欢它。转到源页面并检查主干。设置它并注意到它看起来与屏幕截图完全不同。没有仪表板,没有侧面板,不同颜色的元素和模型项目列表非常狭窄。
从那时起,我想知道我是否做错了什么并更仔细地阅读文档。偶然发现了管理工具,也安装了它们。仪表板出现了,但按钮又错位了,元素的位置也不同了。并且还没有解决项目列表狭窄的问题。
这相当令人失望,但我决定继续潜伏。并检查了分支 2_2。这最终看起来像 django 项目中的屏幕截图。小型 mce 也起作用了!
那么,问题一:这是每个想要使用 grappelli 的人都会做的事情吗?或者这些截图实际上是后备箱版本的,只是害羞向我展示它的美丽?
之后我决定安装 filebrowser。去了谷歌项目页面,阅读了说明,注意到了 grappellii 的要求,并很高兴地认为这很容易,因为我已经得到了它。
因此,我检查了主干,将媒体放置在其所属的位置,创建了必要的路径,并且它起作用了。但看起来很糟糕。搜索字段和过滤器与简单的 django admin 或 grappelli 完全不同,列表很窄,过滤器不起作用。而且像右侧按钮这样的奇怪齿轮也不起作用。
好吧,这并没有阻止我浏览模板,到处修复它们,它们开始看起来或多或少还不错。但像按钮这样奇怪的装备仍然不起作用。更糟糕的是,来自小型 MCE 的图像插入对话框也无法工作。它出现了,显示了我的文件夹和文件,但“选择”按钮被禁用。
现在我开始认为我做错了什么,
- 我将文件浏览器恢复到主干。 “选择”按钮仍然不起作用。
- 我把所有东西都清理掉,然后把抓斗放回后备箱。文件浏览器看起来仍然有些混乱,最糟糕的是“选择”按钮仍然不起作用。
- 我尝试了 filebrowser-no-grappelli,它甚至没有这些按钮。
- 我放弃了,来到这里寻求安慰
那么,问题二:每个想要使用带有微型 MCE 插入图像对话框的文件浏览器的人都会走同样的路吗?你成功了吗?请帮助我做同样的事情。
TL/DR:如何为 django admin 设置 grappelli 和 filebrowser 并使小型 MCE 插入图像对话框正常工作?
我使用 django 1.2.1。
So, I found django admin interface called 'grappelli'. Looked at the screenshots and decided that I like it. Went to sources page and checked out trunk. Set it up and noticed that it looks nothing like screenshots. No dashboard, no side panel, different colors of the elements and model item lists are very narrow.
From that point I'm wondering if I did something wrong and read the docs more closely. Stumbled upon admin-tools, installed them too. Dashboard appeared but it had misplaced buttons and different placements of the elements again. And haven't solved the problems with narrow item lists.
That was rather disappointing, but I decided to lurk more. And checked out branch 2_2. This finally looked like the screenshots in the django project. And tiny mce worked too!
So, question one: is this what everybody who want use grappelli do? Or are those screenshots actually for trunk version and it's just shy to show its beauty to me?
After that I decided to install filebrowser. Went to google project page, read the instruction, noticed grapplelli requirement and rejoiced thinking it'd be easy since I already got it.
So, I checked out trunk, placed the media where it belongs, created paths necessary and it worked. But looked awful. Search field and filters are nothing like in the simple django admin or grappelli, list is narrow, filters do not work. And weird gear like buttons on the right do not work either.
Well, it didn't discourage me to browse through templates, fix them here and there and they started to look more or less ok. But weird gear like buttons still didn't work. And what's worse, image insertion dialog from tiny MCE wasn't working either. It appeared, showed my folders and files but 'Choose' button was disabled.
Now I start to think that I did something wrong and
- I reverted filebrowser back to trunk. 'Choose' buttons still don't work.
- I wiped out everything and reverted grappelli to trunk. Filebrowser still looks somewhat messed up and worst of all 'Choose' buttons still don't work.
- I tried filebrowser-no-grappelli and it doesn't even have those buttons.
- I gave up and went here seeking comfort
So, question two: does everybody who wants to use filebrowser with tiny MCE insert image dialog walk the same path? Have you managed to make it work? Please, help me do the same.
TL/DR: How to set up grappelli and filebrowser for django admin and make tiny MCE insert image dialogs work?
I use django 1.2.1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当前的 grappelli 版本是 2.1。它应该可以在 django 1.2.1 和当前的文件浏览器版本上正常工作!我认为谷歌代码网站上的屏幕截图来自旧版本,其中包含书签支持等,但已从实际版本中删除,因为此功能(还有仪表板等)现在应该通过管理工具处理!正如您现在可能已经有了 grappelli-admin-tools (http://bitbucket.org/ fetzig/grappelli-admin-tools/overview),它已经使您能够自定义索引页面,并且书签功能也应该移到那里!请务必仔细阅读安装说明:http://bitbucket.org/fetzig /grappelli-admin-tools/wiki/Home (不要忘记最后执行 python 脚本!)tinymce/filebrowser 正在为我使用这个组合......
The current grappelli version is 2.1. It should work without problems with django 1.2.1 and the current filebrowser version! I think the screenshots on the google code site come from an older version, that had bookmark support etc included, but was removed from the actual version because this functionality (also dashboard etc) should be handled through admin-tools now! As you maybe already now there's grappelli-admin-tools (http://bitbucket.org/fetzig/grappelli-admin-tools/overview) which already enables you to customize your index page and the bookmarks functionality should be moved there as well! Make sure to read the install instructions carefully: http://bitbucket.org/fetzig/grappelli-admin-tools/wiki/Home (do not forget to execute the python scripts at the end!) tinymce/filebrowser is working for me with this combination....
通过不将管理媒体前缀设置为“/media/grappelli/”,我设法使管理站点看起来像 django 简单管理界面。只是将其保留为“/static/admin/”,它看起来并没有破坏任何东西,但我无法让“选择”以任何方式工作。
I managed to get the admin site to look like the django simple admin interface by not setting my admin media prefix to '/media/grappelli/'. Just left it as '/static/admin/' and it didn't break anything seemingly, I've not been able to get the 'choose' to work either way though.
我遇到了类似的问题,但是遵循 Christopher 更改 ADMIN_MEDIA_PREFIX 的建议非常有效。我所做的只是以下内容:
旧:
新:
I was running into similar issues, but following Christopher's advice of changing the ADMIN_MEDIA_PREFIX worked like a charm. All I did was the following:
old:
new: