我已经安装并配置了https://django-admin-tools-stats.readthedocs.io/en/latest/index.html
中提到的django-admin-tools-stats但是我无法生成任何图表,或者我的管理界面上没有显示图表的小部件。
我的settings.py
INSTALLED_APPS = (
#Admin Dashboard
'admin_tools',
'admin_tools.theming',
'admin_tools.menu',
'admin_tools.dashboard',
#For the admin interface statistics
'admin_tools_stats',
'django_nvd3',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.admin',
'rest_framework',
#Rest-auth
'rest_framework.authtoken',
'rest_auth',
#Rest-auth registration
'allauth',
'allauth.account',
'rest_auth.registration',
#Following is added to allow cross domain requests i.e. for serving requests those are coming from frontend app
'corsheaders',
#Admin reg stats
'admin_user_stats',
'chart_tools',
#'djangobower',
'flights',
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
#'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
],
'loaders': (
'admin_tools.template_loaders.Loader',
#'django.template.loaders.filesystem.load_template_source',
#'django.template.loaders.app_directories.load_template_source',
'django.template.loaders.app_directories.Loader',
#'django.template.loaders.filesystem.Loader',
),
},
},
]
#To use custom admin dashboard, edit dashboard.py file to make any changes
ADMIN_TOOLS_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard'
ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'dashboard.CustomAppIndexDashboard'
可能是什么原因?
答案 0 :(得分:0)
您是否已将django-admin-tools添加到您的urls.py文件中,如下所示 -
urlpatterns = patterns('',
url(r'^admin_tools/', include('admin_tools.urls')),
#...other url patterns...
)
并确保使用 -
进行迁移 python manage.py migrate