Django modPy

A Django app for enabling content and template management. Inspired by MODx.

modPy can be used in a number of ways to add help your application manage content. From small reuseable content blocks to entire pages. modPy includes built in caching for pages and templates as well as playing nice with common django apps debug toolbar and south.


What are modPy's prerequisits?

modPy requires Django (<= 1.3) with a working database configured.

Internally modPy makes heavy use of caching to improve performance a working cache provider is therefore recommended.

For a development environment django-debug-toolbar is strongly recommended.

modPy now includes support for South migrations.

Integrating modPy into your Django project

Add modpy into the INSTALLED_APPS collection of your settings file.

modPy can be used in several ways, each of these items is optional.

modPy as a CMS For modPy to behave as a CMS and provide content referenced by a URL (similar to Flatpages) the page middleware is required.

Add modpy.middleware.page.PageMiddleware to the MIDDLEWARE_CLASSES collection.

The middleware should be installed _after_ any other middleware that may modify the output. If you are using django-debug-toolbar be sure it is listed before the page middleware so that the debug toolbar can be rendered into pages output by modPy.

modPy as a Template loader To have modPy manage templates within your Django project (similar DBTemplates) enable the modPy Template Loader.

Add modpy.loaders.TemplateLoader to the TEMPLATE_LOADERS collection.

It is not advisable to use of the cache loader provided with Django when using the modPy loader. The modPy loader template caching itself but includes features to invalidate the cache if the template is later modified.

Using with Django debug toolbar modPy comes with a fixed version of the RequestVarsDebugPanel to solve a bug which causes an exception while rending the panel on any URL handled by the PageMiddleware.

Thanks to