Registry / web-framework / django-ckeditor-5

django-ckeditor-5

JSON →
library0.2.20pypypi✓ verified 84d ago

django-ckeditor-5 is a Django application that seamlessly integrates the modern CKEditor 5 rich text editor into Django projects, offering an intuitive content creation experience. It provides features like text formatting, image uploads, tables, and code blocks, making it highly customizable. This package is specifically for CKEditor 5, distinct from the older `django-ckeditor` which uses CKEditor 4. The current version is 0.2.20, with a generally active release cadence.

pip install django-ckeditor-5
INSTALL
IMPORT
SIG · DJANGO-CKEDITOR-5
D
django-ckeditor-5
web-frameworkpythonv0.2.20
Install
4.1s avg
Import
Disk
98MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.20 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 98.7MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.1s · import 0.000s · 100MB
98MB installed
● package 98MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VERSION
from django_ckeditor_5 import VERSION
import django_ckeditor_5

To quickly integrate `django-ckeditor-5`, first add `django_ckeditor_5` to your `INSTALLED_APPS` and define `MEDIA_URL`, `MEDIA_ROOT`, and `CKEDITOR_5_CONFIGS` in your `settings.py`. Then, use `CKEditor5Field` in your Django models for rich text fields and `CKEditor5Widget` in your forms. Ensure `{{ form.media }}` is included in your templates for the editor to render correctly.

import os from django.db import models from django.forms import ModelForm from django.conf import settings from django_ckeditor_5.fields import CKEditor5Field from django_ckeditor_5.widgets import CKEditor5Widget # settings.py additions (example) # INSTALLED_APPS = [ # ..., # 'django_ckeditor_5', # ] # MEDIA_URL = '/media/' # MEDIA_ROOT = os.path.join(BASE_DIR, 'media') # CKEDITOR_5_CONFIGS = { # 'default': { # 'toolbar': ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'imageUpload', 'fileUpload'], # 'language': 'en', # 'width': 'auto' # } # } class Article(models.Model): title = models.CharField(max_length=200) content = CKEditor5Field(verbose_name='Rich Content', config_name='default') def __str__(self): return self.title class ArticleForm(ModelForm): class Meta: model = Article fields = '__all__' widgets = { 'content': CKEditor5Widget(config_name='default') } # In a Django template, if using a form: # {% extends 'base.html' %} # {% block content %} # <form method="POST"> # {{ form.media }} <!-- IMPORTANT: Don't forget this! --> # {% csrf_token %} # {{ form.as_p }} # <button type="submit">Submit</button> # </form> # {% endblock content %}
Debug
Known issues
breakingThis library is for CKEditor 5, which is a complete rewrite from CKEditor 4. Code and configuration for the older `django-ckeditor` (which uses CKEditor 4) are not compatible and will not work.
fix
Ensure you are installing `django-ckeditor-5` and following its specific documentation. Do not confuse it with `django-ckeditor`.
affects: All versions
gotchaWhen using `CKEditor5Widget` in forms, especially outside of the Django admin, you MUST include `{{ form.media }}` in your HTML template's `<head>` or before the form. Without it, CKEditor 5's JavaScript and CSS assets will not load, and the editor will not render or function correctly.
fix
Add `{{ form.media }}` inside the `<head>` tag or within the `<body>` before your form in the template where the CKEditor 5 field is used.
affects: All versions
gotchaEnabling file/image uploads without proper validation or restrictions can pose a security risk. The library warns that uploaded files are not validated by default, and allowing generic file uploads disables image-specific validation.
fix
Implement robust server-side validation for uploaded files (e.g., file type, size, content scanning). Consider restricting file types or limiting uploads to trusted users. Configure `CKEDITOR_5_MAX_FILE_SIZE` in settings.py to limit file sizes.
affects: All versions
Upgrade
Version history
0.2.20latest on PyPI · released Feb 21, 2026
Audit
Dependencies
djangorequiredCore framework dependency for any Django application.
PillowrequiredRequired for image manipulation and uploads within the editor.
Agent activity
26 hits · last 30 days
node
26
Resources
django-ckeditor-5 — pip install django-ckeditor-5 · libregistry