5
我有一个现有的django应用程序,我需要集成django-cms。 Django-cms将主要用于为应用程序创建帮助文档。我已经设置了django-cms来使用我现有的数据库,以保持用户和auth的一致性。将现有的django应用程序与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插件。
任何帮助在这里将不胜感激。 谢谢。
---编辑--- 感动编辑区段到一个新的问题
我试图访问这些文档时遇到权限被拒绝错误。 有什么想法? – 2016-09-10 23:32:20
@OlegTikhonov这里是可访问的链接http://docs.django-cms.org/en/release-3.3.x/how_to/apphooks.html – 2016-11-29 14:11:24