姜戈·格拉佩利错误

发布于 2024-11-13 23:15:35 字数 229 浏览 2 评论 0原文

我对姜戈·格拉佩利有意见。它似乎加载 CSS 得很好,但样式似乎......关闭。也许一些图片可以澄清我的意思:

http://imgur.com/eRlaX

http://imgur.com/T11Xt

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:

http://imgur.com/eRlaX

http://imgur.com/T11Xt

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

眼藏柔 2024-11-20 23:15:35

我刚刚遇到了这个。您需要确保 'grappelli' 出现在 INSTALLED_APPS 中的 'django.contrib.admin' 之前。

I just ran into this. You need to make sure that 'grappelli' appears before 'django.contrib.admin' in INSTALLED_APPS.

月亮是我掰弯的 2024-11-20 23:15:35

您使用的是哪个版本的 Django 和 Grappelli?您是否遵循了自述文件? Grappelli 在默认管理 css 之上使用它自己的 CSS,因此看起来它没有加载 grappelli css。

如果您使用的是 Django 1.3,则需要运行:

./manage collectstatic

将 grappelli 所需的所有 CSS 导入到 static 文件夹中。还要确保 grappelli 位于 urls.py 的顶部(在 admin 之前):

urlpatterns = patterns('',
    url(r'^grappelli/', include('grappelli.urls')),
    ...

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:

./manage collectstatic

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):

urlpatterns = patterns('',
    url(r'^grappelli/', include('grappelli.urls')),
    ...
dawn曙光 2024-11-20 23:15:35

如果您自己已经修改了管理模板,也会发生这种情况。由于 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.

彼岸花似海 2024-11-20 23:15:35

我想我刚刚遇到了这个问题。我最初从 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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文