gpt4 book ai didi

Django: Grappelli 自定义仪表板

转载 作者:行者123 更新时间:2023-12-01 10:43:56 26 4
gpt4 key购买 nike

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

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

设置.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)),
)

有什么建议吗?

最佳答案

你看到文档了吗?

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

尝试在设置“INSTALLED_APPS”中的“grappelli”之前定义“grappelli.dashboard”

然后,要自定义仪表板,您需要创建dashboard.py 文件(参见文档)

关于Django: Grappelli 自定义仪表板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28235932/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com