【发布时间】:2011-07-07 15:28:27
【问题描述】:
我有一个现有的 django 应用程序,我需要与它集成 django-cms。 Django-cms 将主要用于为应用程序创建帮助文档。我已经设置 django-cms 使用我现有的数据库,以保持用户和身份验证一致。
理想情况下,在帮助页面中,我需要来自现有应用程序的客户特定信息,并且还为文档团队提供编辑功能。
这是我写的一个示例视图:
def view_help(request, company):
try:
c = Company.objects.get(id=company)
except:
return render_to_response('help.html', {'msg':'No Such company'})
return render_to_response('help.html', {'company':c, 'data':c.data})
对应模板help.html:
{% load cms_tags %}
{% load custom_tags %}
<!doctype html>
<head>
<title>{{company}}</title>
{% plugins_media %}
</head>
<body>
{% placeholder "main" %}
{% if msg %}
{{msg}}
{% else %}
Here is company specific data: <br/>
{{ data }}
{% endif %}
</body>
</html>
这提供了我需要的公司特定信息,但没有提供 cms 插件。
这里的任何帮助将不胜感激。 谢谢。
--- 编辑 --- 将已编辑的部分移至新问题
【问题讨论】:
标签: django django-cms