Skip to main content

django-jodit

PyPI version Python Version Django Version License: MIT Tests Coverage

A Django app to easily integrate the Jodit WYSIWYG editor into Django forms and admin.

🎥 Live Demo

Check out the example project to see django-jodit in action!

Features

  • 🎨 Full-featured WYSIWYG editor with Jodit
  • 📝 Easy integration with Django forms and admin
  • ⚙️ Highly configurable through Django settings
  • 🎯 Model field and form field support
  • 📦 Includes all necessary static files (CSS/JS)
  • 🔧 Custom configuration per field
  • 🌐 Multi-language support

Installation

From PyPI (Recommended)

pip install django-jodit
uv add jodit

From Source

pip install git+https://github.com/mounirmesselmeni/django-jodit.git

Local Development

git clone https://github.com/mounirmesselmeni/django-jodit.git
cd django-jodit
pip install -e .

Quick Start

1. Add to INSTALLED_APPS

Add 'jodit' to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = [
    ...
    'jodit',
    ...
]

2. Configure (Optional)

Add custom Jodit configurations to your settings.py:

JODIT_CONFIGS = {
    'default': {
        'height': 400,
        'width': '100%',
        'toolbar': True,
        'buttons': [
            'source', '|',
            'bold', 'italic', 'underline', '|',
            'ul', 'ol', '|',
            'font', 'fontsize', 'brush', 'paragraph', '|',
            'image', 'table', 'link', '|',
            'align', 'undo', 'redo', '|',
            'hr', 'eraser', 'fullsize',
        ],
    },
    'simple': {
        'height': 200,
        'toolbar': True,
        'buttons': ['bold', 'italic', 'underline', 'link'],
    },
}

Usage

In Models

from django.db import models
from jodit.fields import RichTextField

class Article(models.Model):
    title = models.CharField(max_length=200)
    content = RichTextField()  # Uses 'default' config
    summary = RichTextField(config_name='simple')  # Uses 'simple' config

In Forms

from django import forms
from jodit.fields import RichTextFormField

class ArticleForm(forms.Form):
    content = RichTextFormField()
    summary = RichTextFormField(config_name='simple')

In Admin

The widget will automatically be used in the Django admin for RichTextField fields:

from django.contrib import admin
from .models import Article

@admin.register(Article)
class ArticleAdmin(admin.ModelAdmin):
    list_display = ['title']

Using the Widget Directly

from django import forms
from jodit.widgets import JoditWidget

class MyForm(forms.Form):
    content = forms.CharField(widget=JoditWidget(config_name='default'))

Dark Theme Support 🌙

Django-Jodit automatically detects and supports dark mode!

Auto-Detection

By default, the editor automatically detects:

  • ✅ Django admin dark mode (data-theme="dark")
  • ✅ Custom dark mode classes

Configuration

JODIT_CONFIGS = {
    'default': {
        'theme': 'auto',  # Auto-detect (default)
    },
    'dark': {
        'theme': 'dark',  # Force dark theme
    },
    'light': {
        'theme': 'default',  # Force light theme
    },
}

The editor dynamically updates when you switch themes in Django admin!

Custom Jodit Versions 📦

Use different Jodit versions by specifying custom URLs:

Use CDN

# settings.py

# Use specific version
JODIT_JS_URL = 'https://unpkg.com/jodit@4.7.9/es2021/jodit.min.js'
JODIT_CSS_URL = 'https://unpkg.com/jodit@4.7.9/es2021/jodit.min.css'

# Or use latest (not recommended for production)
JODIT_JS_URL = 'https://unpkg.com/jodit@latest/es2021/jodit.min.js'
JODIT_CSS_URL = 'https://unpkg.com/jodit@latest/es2021/jodit.min.css'

Use Local Custom Files

# settings.py
JODIT_JS_URL = '/static/custom/jodit.min.js'
JODIT_CSS_URL = '/static/custom/jodit.min.css'

Use Bundled Version (Default)

# No configuration needed - uses bundled Jodit 4.7.9
# Or explicitly set to None
JODIT_JS_URL = None
JODIT_CSS_URL = None

Configuration Options

The Jodit editor supports many configuration options. Here are some common ones:

JODIT_CONFIGS = {
    'default': {
        # Editor dimensions
        'height': 400,
        'width': '100%',

        # Toolbar settings
        'toolbar': True,
        'toolbarButtonSize': 'middle',  # small, middle, large
        'toolbarAdaptive': True,

        # Editor behavior
        'spellcheck': True,
        'language': 'auto',  # or specific language code
        'askBeforePasteHTML': True,
        'askBeforePasteFromWord': True,

        # UI elements
        'showCharsCounter': True,
        'showWordsCounter': True,
        'showXPathInStatusbar': False,

        # Image handling
        'uploader': {
            'insertImageAsBase64URI': True,
        },

        # Custom buttons
        'buttons': [
            'source', '|',
            'bold', 'italic', 'underline', 'strikethrough', '|',
            'ul', 'ol', '|',
            'outdent', 'indent', '|',
            'font', 'fontsize', 'brush', 'paragraph', '|',
            'image', 'table', 'link', '|',
            'align', 'undo', 'redo', '|',
            'hr', 'eraser', 'copyformat', '|',
            'symbol', 'fullsize', 'print',
        ],
        'removeButtons': [],  # List of buttons to remove
    },
}

For a complete list of configuration options, see the Jodit documentation.

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/mounirmesselmeni/django-jodit.git
cd django-jodit

# Install dependencies
uv sync --dev

Running Tests

# Run tests with coverage
uv run python manage.py test jodit

# Or with coverage report
uv run coverage run --source='jodit' manage.py test jodit
uv run coverage report
uv run coverage html  # Generate HTML report

Code Quality

# Format code
uv run ruff format .

# Lint code
uv run ruff check .

# Install pre-commit hooks
uv run pre-commit install

Project Structure

django-jodit/
├── jodit/
│   ├── __init__.py
│   ├── apps.py
│   ├── configs.py          # Default Jodit configurations
│   ├── fields.py           # RichTextField and RichTextFormField
│   ├── models.py
│   ├── settings.py         # Settings utilities
│   ├── widgets.py          # JoditWidget
│   ├── tests.py            # Test suite
│   ├── testsettings.py     # Test Django settings
│   ├── static/
│   │   └── jodit/
│   │       ├── jodit.min.js
│   │       ├── jodit.min.css
│   │       └── jodit-init.js
│   └── templates/
│       └── jodit/
│           └── widget.html
├── LICENSE
├── MANIFEST.in
├── README.md
├── manage.py
└── pyproject.toml

Screenshots

Django Admin Integration

The Jodit editor seamlessly integrates with Django admin, providing rich text editing capabilities out of the box.

Custom Forms

Use Jodit in your custom forms with full control over configuration and styling.

Multiple Configurations

Different editor configurations for different use cases - full-featured editor for main content, simple editor for excerpts and comments.

Example Project

A complete example project is included in the example_project/ directory. It demonstrates:

  • ✅ Blog application with posts and comments
  • ✅ Django admin integration
  • ✅ Multiple editor configurations
  • ✅ Frontend forms with Jodit
  • ✅ Rich text content display

Running the Example

cd example_project
./setup.sh
python manage.py runserver

Visit http://127.0.0.1:8000/ to see it in action!

Jodit Version

This package includes Jodit Editor version 4.7.9.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Changelog

0.1.1 (2026-08-27)

  • Update dependencies to support Django 6.1 and Python 3.14
  • Drop support for Django < 5.2
  • Upgrade jodit to v4.13.9

0.1.0 (2025-11-13)

  • Initial release
  • Basic Jodit editor integration (v4.7.9)
  • Model field and form field support
  • Django admin integration
  • Configurable through Django settings
  • Comprehensive test suite (96% coverage)
  • Example project with blog application
  • GitHub Actions CI/CD with PyPI publishing

Release files for django-jodit 0.1.1

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

Source distribution (sdist)

Source distribution for django-jodit 0.1.1
File Size Uploaded
django_jodit-0.1.1.tar.gz 261.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-jodit 0.1.1
File Interpreter ABI Platform
django_jodit-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 524.8 kB

Release files / django_jodit-0.1.1.tar.gz

Download URL django_jodit-0.1.1.tar.gz
Size 261.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f3be9815695e9faf89e7652870aad3f553859f629daf4b48ddc325d51af50f8a
BLAKE2b-256 checksum
How to use checksums
cc3bacea0c5a14d4e1cfa25575290ec9b952e6b6047728f00ffbda968829100f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 27, 2026.

Transparency log

Release files / django_jodit-0.1.1-py3-none-any.whl

Download URL django_jodit-0.1.1-py3-none-any.whl
Size 263.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e741784489580c87c27caeef9eae161f4010dc46bdef5ecfd6aabb9ce0e8d83
BLAKE2b-256 checksum
How to use checksums
d8566919abf1e50ee97004154e27377031f7543daff31eb57dd6e6b62c55865f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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