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-5Verified import paths — ran on the pinned version, not inferred.
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.
Ensure you are installing `django-ckeditor-5` and following its specific documentation. Do not confuse it with `django-ckeditor`.
Add `{{ form.media }}` inside the `<head>` tag or within the `<body>` before your form in the template where the CKEditor 5 field is used.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.