Skip to main content

A CKEditor widget for Django that includes an admin mixin.

Project description

A CKEditor widget for Django that includes an admin mixin.

How to use

Install using pip:

pip install django-ckeditor-widget

Then use as any other widget:

from django import forms
from ckeditor_widget.widgets import CKEditorWidget

class MyForm(forms.Form):
    body = forms.TextField(widget=CKEditorWidget)

https://docs.djangoproject.com/en/1.11/ref/forms/widgets/#specifying-widgets

Make sure that CKEditor is provided in static files as ckeditor/ckeditor.js.

Admin

The app conveniently provides an admin mixin that uses CKEditor for all text fields. Simply inherit from the mixin:

from django.contrib import admin
from ckeditor_widget.admin import CKEditorAdminMixin
from myapp import models

@admin.register(models.Product)
class ProductAdmin(CKEditorAdminMixin, admin.ModelAdmin):
    pass

Akternatively, specify formfield_overrides:

formfield_overrides = {
    models.TextField: {'widget': CKEditorWidget}
}

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-ckeditor-widget-0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

django_ckeditor_widget-0.1-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-ckeditor-widget-0.1.tar.gz.

File metadata

File hashes

Hashes for django-ckeditor-widget-0.1.tar.gz
Algorithm Hash digest
SHA256 4ea5042142764c061e8edf158e13c33036f5c30703590502cd8695904d6de82d
MD5 9c27327a59586ea9ecf92b9436dc6260
BLAKE2b-256 12aa00378e79fa0952369bfbef99727e3de2aad4c3f87ccea8ca7276a05d0c5d

See more details on using hashes here.

File details

Details for the file django_ckeditor_widget-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_ckeditor_widget-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 48f26d98e2a452c3427f701eb21dfad0f1e2b79b7c7f6b99956453adba72eb48
MD5 03e820bfea04a051225ea31ff769cda3
BLAKE2b-256 7f8c0594b4f5781be79b1666022b775e0800e49bac40f271ea9475dba6560e13

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page