Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: Grappelli custom dashboard

I'm having problems with the Dashboard of Grappelli because I cannot see any change in my admin interface. What I'm trying to do is to show my models in different boxes. This is my configuration:

myproj
    ├── myproj
    │   ├──url.py
    │   ├──settings.py
    ├── manage.py
    ├── db_personal #myapp
    │   ├── admin.py
    │   ├── models.py
    |   ├── viewss.py
    ├── templates.py
    ├── dashboard.py

settings.py

INSTALLED_APPS = (
    'grappelli',
    'grappelli.dashboard',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    "db_personal" #app
)

TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.contrib.messages.context_processors.messages",
"django.core.context_processors.request"
)

GRAPPELLI_INDEX_DASHBOARD = {'django.contrib.admin.site': 'db_personal.dashboard.CustomIndexDashboard'}

urls.py

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

Anny suggestion?

like image 748
loar Avatar asked Mar 17 '23 05:03

loar


2 Answers

Did you see documentation ?

http://django-grappelli.readthedocs.org/en/latest/dashboard_setup.html

try define 'grappelli.dashboard' before 'grappelli' in your settings 'INSTALLED_APPS'

then, to cutomize dashboard you need to create the dashboard.py file (see doc)

like image 172
J-E Casta Avatar answered Mar 28 '23 19:03

J-E Casta


I had a similar problem. You just have to put 'grappelli.dashboard' before 'grappelli' in INSTALLED_APPS:

INSTALLED_APPS = (
    ....
    'grappelli.dashboard',
    'grappelli',
    ....
)
like image 28
zablotski Avatar answered Mar 28 '23 21:03

zablotski