Skip to main content

django CMS text CKEditor 5

pypi PyPI - django CMS Versions from Framework Classifiers

djangocms-text-ckeditor5 is an extension to djangocms-text offering CKEditor5 as a rich text editor to djangocms-text.

Features

  • CKEditor 5: Look and feel of CKEditor 5.

  • Inline editing: CKEditor 5 supports inline editing.

  • Dynamic HTML attributes: Supported for the Link plugin.

  • CMS plugin embedding: Add CMS plugins from the editor toolbar (“CMS Plugins” dropdown, plus optional dedicated buttons for plugins with their own icon) and double-click an embedded plugin to edit it in place.

  • Translated user interface: The CKEditor 5 UI follows the language of the django CMS admin.

Installation

Install djangocms-text-ckeditor5 using pip:

pip install djangocms-text-ckeditor5

Build latest development branch using git:

git clone git@github.com:django-cms/djangocms-text-ckeditor5.git
cd djangocms-text-ckeditor5
nvm use
npm install
npm run build:dev          # or `npm run build` for a production bundle
npm test                   # Node's built-in test runner

You then can install the cloned repo using pip install -e /path/to/the/repo/djangocms-text-ckeditor5.

Finally, add djangocms_text_ckeditor5 in addition to djangocms_text to your INSTALLED_APPS in your Django project settings:

INSTALLED_APPS = [
    ...,
    "djangocms_text",
    "djangocms_text_ckeditor5",
    ...
]

and set the editor you want to use:

TEXT_EDITOR = "djangocms_text_ckeditor5.ckeditor5"

Configuration

The editor reads TEXT_EDITOR_SETTINGS from djangocms-text. Its toolbar uses the CKEditor 4 item names shared by all djangocms-text editors; they are translated to the matching CKEditor 5 components (Table becomes insertTable, TextColor becomes cmsTextColor, and so on). Items that CKEditor 5 has no counterpart for – Unlink, Maximize, PasteFromWord, InlineQuote, … – are dropped, as are buttons for CMS plugins that are not installed. CKEditor 5 component names can be used directly as well.

Toolbar items are grouped into a dropdown once the toolbar runs out of space. To lay them out in several rows instead, set shouldNotGroupWhenFull:

TEXT_EDITOR_SETTINGS = {
    "shouldNotGroupWhenFull": True,
}

The user interface language follows the active Django language. The translations ship with the package and are loaded on demand, so only the language actually in use is transferred. A regional code falls back to its base language (de-at uses the German translation); languages CKEditor 5 does not translate stay in English.

Class-based text colors

The TextColor toolbar item uses the same class-based palette as djangocms-text’s Tiptap editor. Choosing a color writes, for example, <span class="text-primary">...</span>. Choosing the active color again, or choosing Remove color, removes it. With the caret inside colored text, the choice applies to that whole colored section. Undo and redo are supported.

The default classes are text-primary, text-secondary, text-success, text-danger, text-warning, text-info, text-light, text-dark, text-body, and text-muted. Replace this palette using textColors:

TEXT_EDITOR_SETTINGS = {
    "textColors": {
        "brand-ink": {"name": "Brand ink"},
        "brand-accent": {"name": "Brand accent"},
    },
}

Define the classes in your site’s CSS and load that CSS in the editor too. Menu previews use these same classes; the plugin does not supply color values. Configured color classes are recognized on existing spans and other HTML elements. Default classes already present in content are kept when you replace the palette, though the menu no longer offers them. Classes from an earlier custom palette are not known to the editor and are dropped on the next save, so keep them in textColors for as long as content uses them. The same applies to backgroundColors. Applying a class clears any inline text color on the selection so the class can take effect. Existing inline colors remain supported by CKEditor’s native fontColor toolbar item, which can be configured separately.

Each palette must be an object mapping a single non-empty CSS class (without whitespace) to a definition with a string name. Invalid entries or palette types prevent editor initialization with cms-class-color-invalid-palette; the error identifies the palette and, for an invalid entry, the class to correct. null uses the default palette; an empty object offers no colors.

Each element can retain one text color and one background color. If imported HTML contains several recognized classes from the same palette on one element, the first class in the configured palette’s key order wins, followed by any remaining default classes in their documented order. The HTML class order and CSS rule order do not affect this choice. Saving keeps only the winning class from each palette. Use one class per palette on each element to preserve the intended appearance. Recognized classes on nested elements take precedence over classes on their ancestors. These rules also apply to backgroundColors.

Class-based background colors

The BGColor toolbar item (cmsBackgroundColor in CKEditor 5) applies background classes with the same preview, toggle, removal, and undo behavior. Text and background colors are independent, so either can be changed or removed without clearing the other. Applying a background class clears an existing inline background color on the selection.

The default palette contains bg-primary, bg-secondary, bg-success, bg-danger, bg-warning, bg-info, bg-light, bg-dark, bg-body, and bg-transparent. Replace it using backgroundColors:

TEXT_EDITOR_SETTINGS = {
    "backgroundColors": {
        "brand-fill": {"name": "Brand fill"},
        "brand-subtle": {"name": "Brand subtle"},
    },
}

Define these background classes in CSS loaded by both the site and the editor. For example, .brand-fill { background-color: #ffe599; } produces <span class="brand-fill">...</span> when selected. The native fontBackgroundColor toolbar item remains available for inline colors.

Text and background palettes must use distinct class names, including the default classes retained for existing content. Overlapping classes prevent editor initialization with cms-class-color-overlapping-palettes; the error identifies the class and palettes to correct.

Deploying class-based colors

Before enabling these palettes, deploy the new editor bundle to every application instance and collect static files. Use versioned static asset URLs (for example, Django’s ManifestStaticFilesStorage) and invalidate any cached HTML or assets that still reference the previous bundle. Have editors reload open editing pages before resuming content changes. During a rolling deployment, pause editing until all instances serve the new bundle: older editors do not recognize these classes and can strip color formatting when they save newly formatted content. Apply the same precautions before a rollback; migrate class-based content or retain a compatible editor before allowing edits with an older version.

Activating the legacy color palettes

To use CKEditor’s original palettes that write inline color and background-color styles, replace TextColor with fontColor and BGColor with fontBackgroundColor in your toolbar configuration:

TEXT_EDITOR_SETTINGS = {
    "toolbar": [
        ["Undo", "Redo"],
        ["Bold", "Italic", "Link"],
        ["fontColor", "fontBackgroundColor"],
    ],
}

This example replaces the default toolbar; include any other toolbar items you want to keep. The native plugins are already included, so no additional plugin installation is needed. Their palettes use CKEditor’s fontColor and fontBackgroundColor settings; textColors and backgroundColors configure the class-based tools only.

Styling the editor content

CKEditor 5 has no editing <iframe>: it edits a contenteditable element in the surrounding document, so in a modal or any admin page the admin’s stylesheets apply to the content being edited.

To scope your own content styles, use djangocms-text’s bodyClass mechanism. Give a plugin a child_ckeditor_body_css_class attribute (or a get_child_ckeditor_body_css_class() method) and every text plugin nested below it gets those class names on the editing root:

class DarkSectionPlugin(CMSPluginBase):
    child_ckeditor_body_css_class = "dark-section"
.ck-editor__editable.dark-section {
    background: #222;
    color: #eee;
}

A global default for every text plugin can be set through the bodyClass key of TEXT_EDITOR_SETTINGS (or of the dict named by TEXT_CONFIGURATION, if you use one). Classes contributed by parent plugins take precedence over it.

Versioning

The minor version of djangocms-text-ckeditor5 reflects the major version of CKEditor 5 included in the package. For example, djangocms-text-ckeditor5 0.48.x includes CKEditor 5 version 48.x.

Contributing

Contributions to djangocms-text-ckeditor5 are welcome! Please read our contributing guidelines to get started.

License

The CKEditor 5 and this package are licensed under the GPL-2.0 License.

Metadata

Release files for djangocms-text-ckeditor5 0.49.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djangocms-text-ckeditor5 0.49.0
File Size Uploaded Provenance Actions
djangocms_text_ckeditor5-0.49.0.tar.gz 5.3 MB With provenance Details for djangocms_text_ckeditor5-0.49.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for djangocms-text-ckeditor5 0.49.0
File Interpreter ABI Platform Actions
djangocms_text_ckeditor5-0.49.0-py3-none-any.whl Python 3 none any Details for djangocms_text_ckeditor5-0.49.0-py3-none-any.whl

Total release size: 10.9 MB

Release files / djangocms_text_ckeditor5-0.49.0.tar.gz

Download URL djangocms_text_ckeditor5-0.49.0.tar.gz
Size 5.3 MB
Tags Source
SHA-256 checksum
How to use checksums
5ee54c067374995ab58d733ad071263471b46d1ffb7c4498417da6fd891210bb
BLAKE2b-256 checksum
How to use checksums
14d059f054b6e29955b5f202ae07fe02de768675c0aa78949cd644f76c1e933f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / djangocms_text_ckeditor5-0.49.0-py3-none-any.whl

Download URL djangocms_text_ckeditor5-0.49.0-py3-none-any.whl
Size 5.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9846e854c805821e69bd226a16e670119f20966a20d6a91fa628a93ed4226c5c
BLAKE2b-256 checksum
How to use checksums
3f7054ae07c7d5477d0e1cc8e5c12061d82691ecbe2d54ead27fba2c9c1991b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for djangocms-text-ckeditor5 0.49.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for djangocms_text_ckeditor5-0.49.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page