我尝试使用 django-grappelli 仪表板,但管理界面出现错误。
Django Version: 1.4.1
Exception Type: ImportError
Exception Value:
No module named dashboard
In template /.../lib/python2.7/site-packages/grappelli/dashboard/templates/admin/index.html, error at line 32
31 {% block content %}
32 {% grp_render_dashboard %}
33 {% endblock %}
我可以在更改之前使用 grappelli 管理界面。采取的步骤是根据手册。我将这些添加到我的 settings.py
GRAPPELLI_INDEX_DASHBOARD = 'myproj.dashboard.CustomIndexDashboard'
...
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.request",
"django.core.context_processors.i18n",
'django.contrib.messages.context_processors.messages',
)
INSTALLED_APPS = (
'grappelli.dashboard',
'grappelli',
'django.contrib.admin',
...
dashboard.py 位于根目录 (myproj) 中。它有一个类。
class CustomIndexDashboard(Dashboard):
myproj
├── admin
│ ├── css
:
├── dashboard.py
├── grappelli
│ ├── images
│ │ ├── backgrounds
├── myapp
│ ├── __init__.py
│ ├── __init__.pyc