Lean enterprise content management powered by Django.
npx @tessl/cli install tessl/pypi-django-cms@5.0.0A comprehensive Django-based enterprise content management system that provides flexible, extensible functionality for building content-driven websites. Django CMS features hierarchical page structure, plugin-based content management, multi-language support, advanced permission systems, and sophisticated admin interface with inline editing capabilities.
pip install django-cmsimport cms
from cms.api import create_page, add_plugin
from cms.models import Page, PageContent, Placeholder, CMSPluginFor template usage:
# In Django templates
{% load cms_tags %}
{% load menu_tags %}from cms.api import create_page, add_plugin
# Create a new CMS page
page = create_page(
title="Welcome",
template="template_1.html",
language="en",
slug="welcome"
)
# Add a text plugin to a placeholder
plugin = add_plugin(
placeholder=page.get_placeholders("en").get(slot="content"),
plugin_type="TextPlugin",
language="en",
body="<h1>Welcome to our site!</h1><p>This is sample content.</p>"
)
# Note: Publishing functionality has been removed from Django CMS core in v4+.
# For publishing, use packages like djangocms-versioning.In Django templates:
{% load cms_tags %}
<!-- Render a placeholder with inheritance -->
{% placeholder "content" %}
<!-- Render page attributes -->
<title>{% page_attribute "title" %}</title>
<!-- Create editable content areas -->
{% placeholder "sidebar" inherit %}Django CMS is built around several core concepts that work together to provide flexible content management:
The plugin architecture enables unlimited extensibility, allowing developers to create custom content types while maintaining consistent editing interfaces and permission systems.
Core functionality for creating, organizing, and managing CMS pages with hierarchical structure, URL routing, template assignment, and multi-language content support.
def create_page(title, template, language, **kwargs): ...
def create_page_content(language, title, page, **kwargs): ...
def get_page_draft(page): ...Extensible plugin architecture for adding modular content components to placeholders, with support for custom plugin development, nested plugins, and plugin-specific permissions.
def add_plugin(placeholder, plugin_type, language, position="last-child", target=None, **data): ...
class CMSPluginBase: ...Template tags and functionality for rendering CMS content in Django templates, including placeholder rendering, page attributes, navigation menus, and inline editing support.
# Template tags (usage in templates)
{% placeholder "slot_name" %}
{% page_attribute "title" %}
{% render_model instance "field" %}Comprehensive permission system with page-level, placeholder-level, and plugin-level permissions, user management utilities, and integration with Django's auth system.
def create_page_user(username, email, password, **fields): ...
def assign_user_to_page(page, user, grant_all=False, **permissions): ...
def can_change_page(request): ...Navigation menu framework with automatic page-based menu generation, custom menu providers, menu modifiers, and template tags for rendering navigation.
class Menu: ...
class Modifier: ...
class NavigationNode: ...Comprehensive utility functions for internationalization, URL handling, configuration management, and CMS-specific operations.
def get_current_language(): ...
def get_page_from_request(request): ...
def get_cms_setting(name): ...class Page:
"""Core page model with tree structure and URL routing."""
class PageContent:
"""Versioned page content with language-specific data."""
class Placeholder:
"""Container for plugins within templates."""
class CMSPlugin:
"""Base model for all CMS plugins."""
class CMSPluginBase:
"""Base class for plugin implementations."""