Skip to main content

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

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

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::



Copyright 2014 Johannes Spielmann <>

django-micro-cms is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

django-micro-cms is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with django-micro-cms, in a file called LICENSE in the root of
the project. If not, see <>.

Project details

Release history Release notifications

History Node


History Node


This version
History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-micro-cms-1.0.tar.gz (5.3 kB) Copy SHA256 hash SHA256 Source None Jan 9, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page