django-cked / README.md

# Django CKEd

**CKEditor and elFinder integration for Django Framework.**

Provides a `RichTextField` and `CKEditorWidget` with upload and
browse support.


![CKEditor](https://bitbucket.org/ssbb/django-cked/raw/default/img/ckeditor.jpg)
![elFinder](https://bitbucket.org/ssbb/django-cked/raw/default/img/elfinder.jpg)

## Installation

    pip install django-cked

or

    pip install -e hg+https://bitbucket.org/ssbb/django-cked#egg=django-cked


## Configuration

1. Add `cked` to your `INSTALLED_APPS` setting.

2. Set `ELFINDER_OPTIONS` in your settings:

    :::python
    ELFINDER_OPTIONS = {
        ## required options
        'root': os.path.join(PROJECT_ROOT, 'media', 'uploads'),
        'URL': '/media/uploads/',
    }

4. Add CKEd URL include to your project `urls.py` file:

    :::python
    url(r'^cked/', include('cked.urls')),

## Settings

- **CKEDITOR_OPTIONS**: CKEditor config.

  See [http://docs.ckeditor.com/#!/guide/dev_configuration](http://docs.ckeditor.com/#!/guide/dev_configuration)
-  **ELFINDER_OPTIONS**: elFinder config. See

   [https://github.com/Studio-42/elFinder/wiki/Client-configuration-options](https://github.com/Studio-42/elFinder/wiki/Client-configuration-options)


## Usage

### Model field

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


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

### Widget

    :::python
    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, dontr forget to include form
media to your template:

    {{ form.media }}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.