Registry / web-framework / django-tinymce

django-tinymce

JSON →
library5.0.0pypypi✓ verified 28d ago

django-tinymce is a Django application that provides a widget to easily integrate the TinyMCE rich text editor into Django forms and models. It allows for highly customizable WYSIWYG editing experiences within Django projects, including the admin interface. The library is actively maintained with regular updates to support newer TinyMCE and Django versions.

pip install django-tinymce
INSTALL
IMPORT
SIG · DJANGO-TINYMCE
D
django-tinymce
web-frameworkpythonv5.0.0
Install
3.6s avg
Import
—
Disk
72MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v5.0.0 · 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.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 72.6MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 3.6s · import 0.000s · 73MB
72MB installed
● package 72MB
Code
Verified usage

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

TinyMCE
✓ from tinymce.widgets import TinyMCE
✗ from tinymce.widgets import TinyMCE

To quickly set up django-tinymce, first install the package and add 'tinymce' to your `INSTALLED_APPS`. Include `tinymce.urls` in your project's `urls.py`. Then, configure TinyMCE settings in `settings.py`, paying attention to `TINYMCE_JS_URL` for the TinyMCE JavaScript source (either self-hosted or CDN) and `TINYMCE_DEFAULT_CONFIG` for editor options. You can use `tinymce.models.HTMLField` directly in your models or `tinymce.widgets.TinyMCE` in your Django forms or admin definitions to apply the rich text editor.

# settings.py import os INSTALLED_APPS = [ # ... 'tinymce', ] # Configure TinyMCE (adjust TINYMCE_JS_URL based on self-hosted or CDN) TINYMCE_JS_URL = 'https://cdn.tiny.cloud/1/no-api-key/tinymce/6/tinymce.min.js' # Example using CDN with no API key # OR for self-hosted: TINYMCE_JS_URL = os.path.join(STATIC_URL, 'tinymce/tinymce.min.js') TINYMCE_DEFAULT_CONFIG = { 'height': 360, 'menubar': False, 'plugins': 'advlist autolink lists link image charmap print preview anchor searchreplace visualblocks code fullscreen insertdatetime media table paste code help wordcount', 'toolbar': 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help', 'custom_undo_redo_levels': 10, 'browser_spellcheck': True, # Important for TinyMCE 6+ spellcheck } # urls.py (project level) from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('tinymce/', include('tinymce.urls')), # Required for TinyMCE views ] # models.py (your app) from django.db import models from tinymce.models import HTMLField class MyRichTextModel(models.Model): title = models.CharField(max_length=200) content = HTMLField() def __str__(self): return self.title # admin.py (your app) from django.contrib import admin from .models import MyRichTextModel from tinymce.widgets import TinyMCE from django import forms class MyRichTextAdminForm(forms.ModelForm): content = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30})) class Meta: model = MyRichTextModel fields = '__all__' @admin.register(MyRichTextModel) class MyRichTextModelAdmin(admin.ModelAdmin): form = MyRichTextAdminForm
Debug
Known issues
breakingVersion 4.0.0 upgraded TinyMCE from v5 to v6. The `spellchecker` plugin was removed; use the `browser_spellcheck` TinyMCE option instead. This requires configuration changes in `TINYMCE_DEFAULT_CONFIG`.
fix
Remove `spellchecker` from TinyMCE plugins in `TINYMCE_DEFAULT_CONFIG`. Set `'browser_spellcheck': True` instead.
affects: 4.0.0+
breakingFollowing the TinyMCE 6 upgrade in v4.0.0, version 4.1.0 further addressed renamed toolbar elements and removed buttons from premium plugins, potentially breaking existing toolbar configurations.
fix
Review and update `toolbar` and `plugins` settings in `TINYMCE_DEFAULT_CONFIG` according to TinyMCE 6 documentation and `django-tinymce` release notes.
affects: 4.1.0+
breakingVersion 3.1.0 removed the jQuery dependency. Consequently, the `TINYMCE_INCLUDE_JQUERY` setting was also removed.
fix
Remove `TINYMCE_INCLUDE_JQUERY` from your `settings.py`. Ensure your project handles jQuery dependencies separately if still needed for other parts of your application.
affects: 3.1.0+
breakingVersion 3.5.0 dropped support for older Python and Django versions. Specifically, Python 3.6 and Django 3.0, 3.1 are no longer supported.
fix
Ensure your project runs on Python >= 3.7 and Django >= 3.2 to use `django-tinymce` v3.5.0 and newer versions.
affects: 3.5.0+
gotchaTinyMCE editor may not display correctly (e.g., no toolbar, basic textarea) if `TINYMCE_JS_URL` is incorrect or if static files are not served properly.
fix
Verify that `TINYMCE_JS_URL` in `settings.py` points to the correct `tinymce.min.js` file (either self-hosted in your static files or a CDN). Ensure Django's static files configuration is correct and that `{{ form.media }}` is included in your template's `<head>` section.
affects: All
gotchaContent edited in TinyMCE might not be saved on form submission, particularly in complex forms or when using custom JavaScript to handle submission.
fix
Before submitting the form, ensure that `tinyMCE.triggerSave()` is called. This forces TinyMCE instances to update their corresponding `<textarea>` elements, making their content available for Django to process.
affects: All
Upgrade
Version history
5.0.0latest on PyPI · released Oct 21, 2025
Audit
Dependencies
DjangorequiredCore framework dependency for the application.
PythonrequiredRequires Python 3.9 or higher.
TinyMCErequiredThe JavaScript rich text editor itself. Can be self-hosted or loaded from a CDN.
Agent activity
21 hits · last 30 days
node
18
Amazon
1
Resources
django-tinymce — pip install django-tinymce · libregistry