Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 781
Hari Avatar asked Mar 02 '11 22:03

Hari


People also ask

What is the difference between Django and django CMS?

Django is a framework that helps you to develop a cms. django-cms is already a developed cms to publish a website.

Does Django have a CMS?

django CMS is a free and open source content management system platform for publishing content on the World Wide Web and intranets. It is written in Django language framework, with Python.

What is the difference between Django and wagtail?

The best choice for you comes down to your needs: django CMS is perfect for enterprises who want to set up an amazing-looking, content-driven website. Wagtail offers additional options for experienced developers who feel confident extending their site's capabilities.


1 Answers

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

like image 66
Bernhard Vallant Avatar answered Oct 03 '22 11:10

Bernhard Vallant