or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.mdmenus.mdpages.mdpermissions.mdplugins.mdtemplates.mdutilities.md
tile.json

tessl/pypi-django-cms

Lean enterprise content management powered by Django.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/django-cms@5.0.x

To install, run

npx @tessl/cli install tessl/pypi-django-cms@5.0.0

index.mddocs/

Django CMS

A 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.

Package Information

  • Package Name: django-cms
  • Language: Python
  • Installation: pip install django-cms

Core Imports

import cms
from cms.api import create_page, add_plugin
from cms.models import Page, PageContent, Placeholder, CMSPlugin

For template usage:

# In Django templates
{% load cms_tags %}
{% load menu_tags %}

Basic Usage

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 %}

Architecture

Django CMS is built around several core concepts that work together to provide flexible content management:

  • Pages: Hierarchical page structure with tree-based organization and URL routing
  • Placeholders: Named content areas within templates that can contain plugins
  • Plugins: Modular content components (text, images, forms, etc.) that can be inserted into placeholders
  • Templates: Django templates that define page layout and placeholder positions
  • Permissions: Granular user and group permissions for pages, placeholders, and plugins
  • Multi-language: Complete internationalization support with language fallbacks
  • Versioning: Draft workflow with content versioning capabilities (publishing requires additional packages like djangocms-versioning)

The plugin architecture enables unlimited extensibility, allowing developers to create custom content types while maintaining consistent editing interfaces and permission systems.

Capabilities

Page and Content Management

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

Page Management

Plugin System

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

Plugin System

Template Integration

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" %}

Template Integration

User Management and Permissions

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

Permissions

Menu System

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

Menu System

Utilities and Helpers

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

Utilities

Types

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."""