Before continuing, you’ll want to be familiar with part one.

It’s time to get django-cms setup. A lot of this is boilerplate stuff, and if you’re familiar with django-cms, you’ll have done this many times before:

Add these lines to the example/ file

import os
gettext = lambda s: s
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))

Modify settings.INSTALLED_APPS, so it’s something like this.


Add the correct middleware and context processors to


Now we need to add a template, as follows:

$ mkdir example/templates
$ touch templates/main.html

Register the template in settings.

    os.path.join(PROJECT_PATH, "templates"),

    ('main.html', 'Main Template'),

Define your language, also in settings:

    ('en', 'English'),

Now let’s configure our example.urls. We’ll enable the admin, and add cms.urls.



urlpatterns = patterns('',
    url(r'^admin/', include(,
    url(r'^', include('cms.urls')),

if settings.DEBUG:
    urlpatterns = patterns('',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
        url(r'', include('django.contrib.staticfiles.urls')),
    ) + urlpatterns

We need to put some markup in templates/main.html. {% raw %} {% load cms_tags sekizai_tags %} {% render_block “css” %} {% cms_toolbar %} {% placeholder base_content %} {% block base_content %}{% endblock %} {% render_block “js” %} {% endraw %}

Before our next deployment, we should setup the database. The following will provision a small Postgres database:

(venv)$ heroku addons:add heroku-postgresql
Adding heroku-postgresql on farm-django-cms-test... done, v9 (free)
Database has been created and is available
 ! This database is empty. If upgrading, you can transfer
 ! data from another database with pgbackups:restore.
Use `heroku addons:docs heroku-postgresql` to view documentation.

Now, we’ll deploy, and setup the database:

$ heroku