Django:Grappelli自定义仪表板

时间:2015-01-30 12:26:56

标签: django django-admin django-grappelli

我在Grappelli的仪表板上遇到问题,因为我看不到管理界面的任何变化。我想要做的是在不同的盒子里展示我的模特。这是我的配置:

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暗示?

3 个答案:

答案 0 :(得分:2)

你看到文件了吗?

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

尝试在设置'INSTALLED_APPS'中'grappelli'之前定义'grappelli.dashboard'

然后,要切割仪表板,您需要创建dashboard.py文件(请参阅doc)

答案 1 :(得分:2)

我有类似的问题。 您只需将'grappelli.dashboard'放在'grappelli'之前INSTALLED_APPS

INSTALLED_APPS = (
    ....
    'grappelli.dashboard',
    'grappelli',
    ....
)

答案 2 :(得分:0)

最后我要做的就是退出并再次登录以查看更改。