姜戈·格拉佩利错误
我对姜戈·格拉佩利有意见。它似乎加载 CSS 得很好,但样式似乎......关闭。也许一些图片可以澄清我的意思:
I'm having issues with Django Grappelli. It seems to be loading the CSS just fine, but the styling seems... off. Perhaps some pictures would clarify what I mean:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我刚刚遇到了这个。您需要确保
'grappelli'
出现在INSTALLED_APPS
中的'django.contrib.admin'
之前。I just ran into this. You need to make sure that
'grappelli'
appears before'django.contrib.admin'
inINSTALLED_APPS
.您使用的是哪个版本的 Django 和 Grappelli?您是否遵循了自述文件? Grappelli 在默认管理 css 之上使用它自己的 CSS,因此看起来它没有加载 grappelli css。
如果您使用的是 Django 1.3,则需要运行:
将 grappelli 所需的所有 CSS 导入到 static 文件夹中。还要确保 grappelli 位于 urls.py 的顶部(在 admin 之前):
what version of Django and Grappelli are you using? Have you followed the readme's? Grappelli uses it's own CSS on top of the default admin css, so it looks like it isn't loading the grappelli css.
If you are using Django 1.3, you need to run:
to import all of the necessary CSS for grappelli into the static folder. Also make sure grappelli is at the top of your urls.py (before admin):
如果您自己已经修改了管理模板,也会发生这种情况。由于 Grapelli 是管理站点的完全替代品,因此您需要首先安装干净的 Grapelli,然后重新应用您可能对新 Grapelli 模板所做的管理更改。
This will also happen if you have already modified the admin templates yourself. As Grappelli is a full substitute of the admin site, you need to first install Grapelli clean and then reapply the admin changes that you might have done over the new Grapelli templates.
我想我刚刚遇到了这个问题。我最初从 http://code.google 下载了 Django-Grappelli 2.3.2。 com/p/django-grappelli/downloads/list,尽管遵循了 快速入门指南;这真是一个令人沮丧的下午。当我使用“svn checkout http://django-grappelli.googlecode 进行检查时.com/svn/trunk/grappelli/ grappelli”,问题就消失了。我猜这是某个地方的错误......
I think I just had this problem. I originally downloaded Django-Grappelli 2.3.2 from http://code.google.com/p/django-grappelli/downloads/list, and the odd CSS behavior you mentioned occurred for me, despite following all the recommended installation procedures listed in the quickstart guide; it made for a frustrating afternoon. When I instead checked it out using "svn checkout http://django-grappelli.googlecode.com/svn/trunk/grappelli/ grappelli", the problem went away. I'm guessing it's a bug somewhere...