Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install django-contentmanager

How to install django-contentmanager

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install django-contentmanager
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
2012.5.9 Failed View build log
11.10.2 Failed View build log
10.4.2 Failed View build log
Windows (64-bit)
2012.5.9 Failed View build log
11.10.2 Failed View build log
10.4.2 Failed View build log
Mac OS X (10.5+)
2012.5.9 Available View build log
11.10.2 Available View build log
10.4.2 Available View build log
Linux (32-bit)
2012.5.9 Available View build log
11.10.2 Available View build log
10.4.2 Available View build log
Linux (64-bit)
2012.5.9 Available View build log
11.10.2 Available View build log
10.4.2 Available View build log
Depended by
Lastest release
version 2012.5.9 on May 23rd, 2012

django-contentmanager is a so-called 'reusable app' to, wait for it, manage content. It does so using plugins that can be scattered over any number of apps, each providing specific types of content. A plugin could list the ten most popular news-stories, highest rated vegetarian dishes or show a selected gallery from a photo-collection app. Of course it could also be a block of (marked up) text.

Quick start

To try it out clone the repository and go to the demoproject-dir.

Assuming you have django on your PYTHONPATH you should be up and running with these commands:

$./manage.py syncdb --noinput
$./manage.py runserver

Then open your browser and go to http://localhost:8000/.

This will bring up a rather plain page (with this README) as an example of a 'paragraph'. If you follow the 'login' link you will go to the admin where you can login with test/test. In your normal project you would have to provide a nicer mechanism for your users to log in (and out) but this is just a quick demo so I'll leave that as an exercise for the reader.

Back at http://localhost:8000/ you will now see a link 'Editmode On'. This will turn on 'editmode' and allow you to add, edit and delete plugins in an, in my opion, intuitive way. Right there on the page: No need to swich back and forth between admin and 'frontend' but instant feedback.

Using the contentmanager

To use the contentmanager in your project or application you'll need to add the contentmanager to your INSTALLED_APPS in settings.py:


make sure your project uses the request-context-processsor:


and finally include contentmanager.urls in your urls.py and run autodiscover:

urlpatterns = patterns(
        (r'^contentmanager/', include('contentmanager.urls')),

from contentmanager import autodiscover

and hook up the the contentmanager in your template(s):

{% load contentmanagertags %}
{% block content %}
{% get_area request 'content' %}
{% end block %}

{% block sidebar %}
{% get_area request 'sidebar' %}
{% end block %}

Writing plugins

Included with the demoapp are a few simple plugin examples (in basicblocks/reveplugins.py) to give you the basic idea.

To write your own plugins you have to add a reveplugins module to you application and subclass from contentmanager.plugins.BasePlugin (or BaseModelPlugin). The most basic plugins just need to define their own render method. The render method is passed the request object and should return a (unicode) string:

class HelloWorld(BasePlugin):
    def render(self, request):
        return "Hello world"

To make the plugin available to the contentmanager and ultimately your users you need to register it:

from contentmanager import registry

Finally, to populate the registry you should include the following in your projects urls.py:

from contentmanager import autodiscover

This will find all reveplugins modules in all your INSTALLED_APPS and load any registered plugins.


The name reveplugins was chosen over simply 'plugins' to prevent naming conflicts. Since the contentmanager is distilled from reveCMS it seemed an appropriate enough name. ReveCMS itself is named afer Karel van het Reve, a dutch writer, not to be confused with his brother Gerard although he is also a fine writer.


Plugins roughly follow the same permission system as django-models. When a plugin is registered the contentmanager automatically creates add, change and delete permissions. Since these permissions could collide with model permissions all plugin permissions are kept in the contentmanager 'namespace' (linked to the content_type PluginType if you really want to know) and are appended with '_plugin'.

For example, a HTML-plugin would have the permissions 'contentmanager.add_html_plugin', 'contentmanager.delete_html_plugin', 'contentmanager.delete_html_plugin'.

Plugins have convenient has_add_permission, has_change_permission, has_delete_permission methods but if you use the proper codename as explained above you can use the standard django permissions system in both python- and templatecode.

Plugins can also add additional permissions in the same manner as django models do except that they are all 'bound' to PluginType.


  • More complex plugin example
  • BaseModelPlugin example
  • Plugin API overview

Subscribe to package updates

Last updated May 23rd, 2012

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.