实施 Django Grappelli 仪表板
我很高兴第一次实现 Grappelli。我试图实现仪表板,但它似乎没有激活。问题是,我不确定它是什么样子。
Grappelli仪表板.py被应用(由createashboard生成)
settings.py(有趣的部分)
MEDIA_ROOT = 'I:/xampp/htdocs/project/media'
MEDIA_URL = 'http://cdn.pd/'
ADMIN_MEDIA_PREFIX = 'http://cdn.project/'
GRAPPELLI_ADMIN_HEADLINE = 'Admin Headline'
GRAPPELLI_INDEX_DASHBOARD = 'pd.dashboard.CustomIndexDashboard'
GRAPPELLI_ADMIN_URL = '/admin/'
TEMPLATE_DIRS = (
'I:/xampp/htdocs/pd/src/templates'
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'grappelli.dashboard',
'grappelli',
'django.contrib.admin',
'south',
)
有人有任何指示吗?这是我的项目的格式。除了基本的 django 启动之外,它是空的:
project - pd
|
|- dashboard.py
|- urls.py
|- settings.py
任何指针都会很酷。
I've happily implemented Grappelli for the first time. I was trying to implement the dashboard but it doesn't seem to be activating. Trouble is, I'm not sure what it looks like.
The Grappelli dashboard.py is applied (generated by createdashboard)
settings.py (interesting parts)
MEDIA_ROOT = 'I:/xampp/htdocs/project/media'
MEDIA_URL = 'http://cdn.pd/'
ADMIN_MEDIA_PREFIX = 'http://cdn.project/'
GRAPPELLI_ADMIN_HEADLINE = 'Admin Headline'
GRAPPELLI_INDEX_DASHBOARD = 'pd.dashboard.CustomIndexDashboard'
GRAPPELLI_ADMIN_URL = '/admin/'
TEMPLATE_DIRS = (
'I:/xampp/htdocs/pd/src/templates'
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'grappelli.dashboard',
'grappelli',
'django.contrib.admin',
'south',
)
does anyone have any pointers? Heres a format of my project. Its empty aside from basic django initiation:
project - pd
|
|- dashboard.py
|- urls.py
|- settings.py
Any pointers would be cool.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对你来说可能有点晚了。您还需要将 django.core.context_processors.request 添加到 TEMPLATE_CONTEXT_PROCESSORS。
settings.py 将包括
:)
This might be a little late for you. You need also need to add django.core.context_processors.request to TEMPLATE_CONTEXT_PROCESSORS.
settings.py will include:
)
检查您的代码中是否没有自定义 templates/admin/index.html 。
我看到 Grapelli 和 grappelli.dashboard 使用不同的文件,
但只有当您使用第二个时,您的仪表板才可见。
Check if you not customized templates/admin/index.html in your code.
I see that grapelli and grappelli.dashboard use different files,
but only when you use second one, your dashboard be visible.