Hari
Hari

Reputation: 101

Integrating existing django application with django-cms

I have an existing django application, with which I need to integrate django-cms. Django-cms will be mainly used to create help documents for the application. I've setup django-cms to use my existing database, so as to keep users and auth consistent.

Ideally in a help page, I would be needing client specific information from my existing application, and also provide editing functionality to the documentation team.

Here is a sample view which I wrote:

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})

Corresponding template 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>

This gives me the company specific information I need, but doesn't give me the cms plugins.

Any help here would be much appreciated. Thanks.

--- Edit --- Moved the edited section to a new question

Upvotes: 5

Views: 2127

Answers (1)

Bernhard Vallant
Bernhard Vallant

Reputation: 50796

You need to attach the application's view to a cms page using a django-cms apphook.

Upvotes: 5

Related Questions