https://github.com/wtower/django-ckeditor-widget
A CKEditor widget for Django that includes an admin mixin.
https://github.com/wtower/django-ckeditor-widget
ckeditor django widget
Last synced: 3 months ago
JSON representation
A CKEditor widget for Django that includes an admin mixin.
- Host: GitHub
- URL: https://github.com/wtower/django-ckeditor-widget
- Owner: Wtower
- License: bsd-3-clause
- Created: 2017-06-04T08:07:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-04T09:12:07.000Z (about 8 years ago)
- Last Synced: 2025-02-21T15:50:17.017Z (4 months ago)
- Topics: ckeditor, django, widget
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
django-ckeditor-widget
======================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 CKEditorWidgetclass 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):
passAkternatively, specify ``formfield_overrides``::
formfield_overrides = {
models.TextField: {'widget': CKEditorWidget}
}