加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python – Django自定义管理仪表板错误

发布时间:2020-12-20 12:40:24 所属栏目:Python 来源:网络整理
导读:我试图使用 django-grappelli仪表板,管理界面给出了错误. Django Version: 1.4.1Exception Type: ImportErrorException Value: No module named dashboardIn template /.../lib/python2.7/site-packages/grappelli/dashboard/templates/admin/index.html,err
我试图使用 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管理界面.
采取的步骤是根据manual.
我将这些添加到我的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

解决方法

好的,它开始工作了. dashboard.py需要移动到myproj / myproj

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读