3

I am unable to get django-grappelli working. Below is what I did -

  1. Installed using pip install django-grappelli.
  2. Added 'grappelli' in INSTALLED_APPS before the 'django.contrib.admin' .
  3. In urls.py, added URL definition url(r'^grappelli/', include('grappelli.urls')), before admin url, ie. url(r'^admin/', include(admin.site.urls))
  4. Executed syncdb and collectstatic commands.

Now when I run command runserver, and browse localhost:8000/admin/, surprisingly I am getting the default admin.

I checked the request traffic in Google Chrome Network tab (in Developers Tool), and I don't see any request for url starting with Grappelli.

I don't know what I am doing wrong. I am using Django 1.4.1-final in virtualenv on Windows 7 machine.

Ravi Kumar
  • 1,382
  • 16
  • 22
  • You are using virtualenv, so have you activated it before making `pip install`? – Tadeck Sep 19 '12 at 03:00
  • Yes, i have activated it before install. I always work inside the vietualenv. Also, I have installed Yolk package, which shows the installed packages and their installation dir in virtualenv. I can also see the django-grapelli in venv/lib/site-packages/. – Ravi Kumar Sep 19 '12 at 13:47

3 Answers3

6

I found the issue. Actually I had previously overridden the Admin Templates for branding my admin login and top page headers. So, in my template dir, there is admin dir with some custom templates (which I copied from django/contrib/admin/templates and edited as per my requirement). Due to this, Grappelli was not showing any of my changes...

I got the hint from here - https://stackoverflow.com/a/12193858/1284552

When I removed it, it worked as expected. Also, I just need to visit the admin path, not the grappelli path as defined in Urls.py.

Community
  • 1
  • 1
Ravi Kumar
  • 1,382
  • 16
  • 22
6

Resolved this issue after adding 'grappelli' at the top of 'django.contrib.admin'.

Adding to Lucian's answer, the documentation itself says,

Insert 'grappelli' at the top of 'django.contrib.admin'.

So INSTALLED_APPS will be,

INSTALLED_APPS = (
    'grappelli',
    'django.contrib.admin',
)

Taken from : http://django-grappelli.readthedocs.org/en/latest/quickstart.html

Nishant Nawarkhede
  • 8,234
  • 12
  • 59
  • 81
2

I had the same thing, I changed the order of the rows and all earned

'grappelli',

'django.contrib.admin',

make sure that the string 'django.contrib.admin' written 1 times

Andrew Nodermann
  • 610
  • 8
  • 13