Merengue is a fully featured CMS framework built on top of the Django framework. It is not only a plug-and-play CMS but also a web framework with which to build CMS sites at top speed – with clean and re-usable code.
In order to achieve this we have:
The goal of this document is to provide enough technical specifics to understand how Merengue works. When you are ready to start a project, you can start with the tutorial or dive right into more detailed documentation.
Django Knowledge Required
Merengue is based on the Django web framework. You need to understand basic Django concepts in order to better understand how Merengue works.
Out of the box, Merengue features the following:
Merengue comes with a complete data model for managing content. All models will be translatable by default and may be geolocalized (if GIS is enabled).
Models features include:
A pluggable system definition depends on the plugin concept. For Merengue, a plugin is an object developed by someone which can be installed without changing a single line of code.
In that sense, when you install a plugin, Merengue will (among other things):
Django Applications
In our concept of a pluggable architecture, Django applications are not considered plugins, as they require some work in order to be integrated into a website (Django URL configuration, settings configuration, syncing of the database, template work, etc.)
Merengue includes a customizable permissions system to manage content. The default permissions configuration is good for the initial CMS setup. You can define roles and permissions for content editing and access as well as grant permissions to Merengue users.
The main advantages obtained from using Django permissions are the increased granularity and the persistent storage of all permission configurations in the database. Permissions are configurable by admin users, using the management interface.
Merengue supports GIS. You can enable GIS support in Merengue by setting a flag. All content is geolocalized and you can edit geographic data via the admin user interface, by viewing it on a map, or by using the Django GIS API to implement whatever GIS features you need.
Merengue uses Johnny Cache to cache all SQL sentences in an intelligent way. With this integration, you can forget about queryset caching and invalidation.
Merengue themes define the look and feel of your CMS website by uncoupling graphic design and template logic. With Merengue, you can use the same content with different appearances:
How does this work? Merengue changes the Django logic controlling template and media loading (including active theme searching).
For example, the next template will render blocks located in leftsidebar into the rightsidebar zone. You only have to create this template as your templates/themes/yourtheme/base.html and activate the theme in the admin interface.
{% extends "base/layout.html" %}
{% load block_tags %}
{% block rightsidebar %}
{% render_blocks "leftsidebar" for content %}
{{ block.super }}
{% endblock %}
Django Knowledge Required
Merengue uses the Django template system. See the Django template documentation for more information about Merengue templating.
The management interface is based somewhat on the Django admin interface (with steroids) and a WYSYWYG interface (e.g. for managing block layout).
Merengue allows the manager to create any content.
Merengue document management includes a collaborative editing tool that allows users to work on the same document simultaneously:
Merengue has several tools for translating both content and language catalogs:
Merengue uses South to implement database schema evolution.
Merengue was created by an enthusiastic team of Python programmers, who love elegant code and clean APIs but also look for the most pragmatic solution to a problem.
Keeping that in mind, Merengue has a well-designed data model in addition to a free, rich Python API. With Merengue, your imagination is the limit!
Some examples follow:
>>> from merengue.base.models import BaseContent
# all contents published in your CMS
>>> BaseContent.objects.published()
[...]
# create a content from a plugin (a news item, that inherits from BaseContent)
>>> from plugins.news.models import NewsItem
>>> newsitem = NewsItem(name_es='Mi noticia', name_en='My news item')
>>> newsitem.publish_date = datetime.datetime.now()
>>> newsitem.save()
# managing permissions
>>> from django.contrib.auth.models import User
>>> staff_user = User.objects.create(username='roque')
>>> from merengue.perms.utils import register_permission, register_role
>>> register_permission('Vote news item', 'vote_newsitem',
for_models=[NewsItem])
>>> editor = register_role('Editor')
>>> editor.add_principal(staff_user) # add user to role 'Editor'
>>> grant_permission(newsitem, editor, 'vote_newsitem')
>>> has_permission(newsitem, staff_user, 'vote')
True
Some CMSs are based on a simple data model using hierarchical pages or nodes without a semantic meaning -- just data.
Merengue content management is based on an extensible base model (non-abstract). All content types (documents, forums, news items, events, etc.) inherit from this base model.
With Merengue you can build a managed system that maps into an existing reality. For example, in the following models we have mapped books and authors, which will be managed in Merengue (because both inherit from BaseContent):
from merengue.base.models import BaseContent
class Author(BaseContent):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
class Book(BaseContent):
authors = models.ManyToManyField(Author)
Merengue plugins can do many things; they are not just place holding renderers.
Plugins can:
This is only an overview of Merengue -- for more information, please see Merengue docs.
You can now download Merengue and read the tutorial.
Apr 12, 2011