Source

django-cked / README.rst

Full commit

Django CKEd

CKEditor and elFinder integration for Django Framework.

Provides a RichTextField and CKEditorWidget with upload and browse support.

https://bitbucket.org/ssbb/django-cked/raw/default/img/ckeditor.jpg https://bitbucket.org/ssbb/django-cked/raw/default/img/elfinder.jpg

Installation

  1. Install or add django-cked to your PYTHONPATH.
  • pip install django-cked
  • pip install -e hg+https://bitbucket.org/ssbb/django-cked
  1. Add cked to your INSTALLED_APPS setting.
  2. Set ELFINDER_OPTIONS in your settings:
ELFINDER_OPTIONS = {
## required options
    'root': os.path.join(PROJECT_ROOT, 'media', 'uploads'),
   'URL': '/media/uploads/',
}
  1. Add CKEd URL include to your project urls.py file: url(r'^cked/', include('cked.urls')),

Settings

Usage

Model field

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


class Entry(models.Model):
    text = RichTextField()

Widget

from django import forms
from cked.widgets import CKEditorWidget

class MyForm(forms.Form):
    text = forms.CharField(widget=CKEditorWidget)

NOTE: If you are using custom forms, dont’r forget to include form media to your template: {{ form.media }}.