Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

A micro-CMS for django. A bit like flatpages++.

Project description


A micro-CMS for django. A bit like flatpages++.

It is not a fully-fledged CMS with online editing and media management. All it does is allow you to manage pages and their templates and translations in the admin (and display the pages on your web site, naturally).


django-micro-cms has no external dependencies other than Django. It was tested against Django 1.6. To install django-micro-cms, simply

pip install django-micro-cms

There are two more things you have to do before you can use it on your page.

  1. Add microcms to your installed apps:

  2. Add a URL config for your pages:

    urlpatterns = patterns('',
        url(r'^page(?P<url>/.*)$', 'microcms.views.pages', name='pages'),
        url(r'^admin/', include(,

    You can add more than one URL config for your pages, but all pages will be available at each endpoint.


Using django-micro-cms is quite simple: create templates, create content, see it on the page. That’s all. All of the editing is done in the Django admin.


First you have to create one or more Template objects. These templates will be rendered when you display a page with it. They can {% extend %} pages from your Django web-page, which is a good idea if you have a base template, but they cannot themselves be extend-ed.

Inside the template, you can use several variables to insert your content:

The page title as a safe string.
The page content as a safe string.
The language code of the loaded content. This may be different from the language code of the page, because the language code of the page depends on the user preferences and the page URL (see below for details on language-loading). However, the language code of the content depends on the availability of content in that language. If no content in the requested language is available, the fallback language is used and that language code will be indicated here.
The date/time of the page creation.
The date/time of the last modification of the page content.


The second step is to create pages and content for them. Pages have a URL and a title. The URL is the part of the page URL that get’s parsed out as the view parameter in your URL definition. So if you have a page with /about/ as URL and in your URL definition this setup:

url(r'^page(?P<url>/.*)$', 'microcms.views.pages'),

then the full URL of that page will be:


The title attribute of the page will be available unescaped in the template as variable title.

For each page, you can add content. Only pages that have content parts defined are shown. If a page has no content in the fallback language, it will only be shown when the requested language version exists.

The content attribute of each language version is given to the template unescaped.

On the page

Each page is available under its URL (once there is at least one content part defined). Additionally, it is also available under its URL with a language code prepended.

An example.

Let’s say you have wired up the pages view as above, to be seen on the page as ^page(?P<url>/.*)$'. Then each page you create will be available at the URL you defined. For example, if you have pages with URLS /about/, /imprint/ and /about/contact/, the will be available as:


If a user requests the page in a locale that has defined content, then the correct content will be served up. If you have content for locales en and de for example, and a user requests the page in German, the de variant of the content will be served. If you have variants in es and es-mx, and a user requests content in es-ar, the es variant will be served.

To allow serving specific languages, you can prepend the language code to the page part of your URL. The above-outlined variants will be available under the following URLs:


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-micro-cms, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django-micro-cms-1.1.0.tar.gz (5.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page