Django Grappelli Error

本秂侑毒 提交于 2019-12-12 12:00:29

问题


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:


回答1:


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




回答2:


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')),
    ...



回答3:


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... Hope it helps.




回答4:


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.



来源:https://stackoverflow.com/questions/6241062/django-grappelli-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!