Skip to main content

Django admin CKEditor integration.

Provides a RichTextField and CKEditorWidget utilizing CKEditor with image upload and browsing support included.

Installation

  1. Install or add django-ckeditor to your python path.

  2. Add ckeditor to your INSTALLED_APPS setting.

  3. Copy the media/ckeditor directory into any directory within your media root. You can override the location in your settings (see below).

  4. Add a CKEDITOR_MEDIA_PREFIX setting to the project’s settings.py file. This setting specifies a URL prefix to the ckeditor JS and CSS media (not uploaded media). Make sure to use a trailing slash:

    CKEDITOR_MEDIA_PREFIX = "/media/ckeditor/"
  5. Add a CKEDITOR_UPLOAD_PATH setting to the project’s settings.py file. This setting specifies an absolute path to your ckeditor media upload directory. Make sure you have write permissions for the path, i.e.:

    CKEDITOR_UPLOAD_PATH = "/home/media/media.lawrence.com/uploads"
  6. Add ckeditor url include to the project’s url.py file:

    (r'^ckeditor/', include('ckeditor.urls')),
  7. Optionally, add a CKEDITOR_UPLOAD_PREFIX setting to the project’s settings.py file. This setting specifies a URL prefix to media uploaded through ckeditor, i.e.:

    CKEDITOR_UPLOAD_PREFIX = "http://media.lawrence.com/media/ckuploads/

(If CKEDITOR_UPLOAD_PREFIX is not provided, the media URL will fall back to MEDIA_URL with the difference of MEDIA_ROOT and CKEDITOR_UPLOAD_PATH appended.)

Usage

Field

The quickest way to add rich text editing capabilities to your models is to use the included RichTextField model field type. A CKEditor widget is rendered as the form field but in all other regards the field behaves as the standard Django TextField. For example:

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

class Post(models.Model):
    content = RichTextField()

Widget

Alernatively you can use the included CKEditorWidget as the widget for a formfield. For example:

from django import forms
from django.contrib import admin
from ckeditor.widgets import CKEditorWidget

from post.models import Post

class PostAdminForm(forms.ModelForm):
    content = forms.CharField(widget=CKEditorWidget())
    class Meta:
        model = Post

class PostAdmin(admin.ModelAdmin):
    form = PostAdminForm

admin.site.register(Post, PostAdmin)

ChangeLog

0.0.1

  1. Added CKEDITOR_UPLOAD_PREFIX setting. Thanks to chr15m for the input.

0.0.2

  1. Included README.rst in manifest.

0.0.3

  1. More robust PIL import, thanks Dusty Phillips.

  2. Better CKEDITOR_MEDIA_PREFIX setting error.

0.0.4

  1. Include resources, sorry about that.

0.0.5

  1. csrf_exempt backwards compatability. Thanks chr15m for the patch.

Metadata

Release files for django-ckeditor 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-ckeditor 0.0.5
File Size Uploaded
django-ckeditor-0.0.5.tar.gz 1.4 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for django-ckeditor 0.0.5
File Interpreter ABI Platform
django_ckeditor-0.0.5-py2.6.egg Legacy Egg format - - Details
django_ckeditor-0.0.5-py2.5.egg Legacy Egg format - - Details

Total release size: 5.2 MB

Release files / django-ckeditor-0.0.5.tar.gz

Download URL django-ckeditor-0.0.5.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
7d3fdd5b1d9dea348697de7d9c6a4ee6e7a0fc701e7cf98e7dfe62cd79d5550e
BLAKE2b-256 checksum
How to use checksums
14051eda2a950ee9a1d8703fd491c468a0781d69c98a95323e2b51f3d2e64c16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_ckeditor-0.0.5-py2.6.egg

Download URL django_ckeditor-0.0.5-py2.6.egg
Size 1.9 MB
Tags Egg
SHA-256 checksum
How to use checksums
a62015b76f5c9ad180e3d13d945849e2736e1120e4958be27877530b4f075fe8
BLAKE2b-256 checksum
How to use checksums
aa55f3bbf10910442d106afe87a2f4f881ff049af513c0908664a500d5f9d191
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_ckeditor-0.0.5-py2.5.egg

Download URL django_ckeditor-0.0.5-py2.5.egg
Size 1.9 MB
Tags Egg
SHA-256 checksum
How to use checksums
5a7c969fd840273ee4946cd135b9be8c4d51c254aeb81781431bbd62664010f6
BLAKE2b-256 checksum
How to use checksums
42c1f8fc7db569d07b4b53f7283eaf7f52ee757acb1377bb10627f219f1dc983
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

6.7.3

2 release files

6.7.2

2 release files

6.7.1

2 release files

6.7.0

2 release files

6.6.1

2 release files

6.6.0

2 release files

6.5.1

2 release files

6.5.0

2 release files

6.4.2

2 release files

6.4.1

2 release files

6.4.0

2 release files

6.3.2

2 release files

6.3.1

2 release files

6.3.0

2 release files

6.2.0

2 release files

6.1.0

2 release files

6.0.0

2 release files

5.9.0

2 release files

5.8.0

2 release files

5.7.1

2 release files

5.7.0

2 release files

5.6.1

1 release file

5.6.0

1 release file

5.5.0

1 release file

5.4.0

1 release file

5.3.1

1 release file

5.3.0

1 release file

5.2.2

1 release file

5.2.1

1 release file

5.2.0

1 release file

5.1.1

1 release file

5.1.0

1 release file

5.0.3

1 release file

5.0.2

1 release file

5.0.1

1 release file

5.0.0

1 release file

4.5.3

1 release file

4.5.1

1 release file

4.5.0

1 release file

4.4.8

1 release file

4.4.7

1 release file

4.4.6

1 release file

4.4.5

1 release file

4.4.4

1 release file

4.2.8

2 release files

4.0.2

2 release files

3.6.2

2 release files

0.0.9

4 release files

0.0.8

3 release files

0.0.7

3 release files

0.0.6

3 release files

This release

0.0.5 This release

3 release files

0.0.4

3 release files

0.0.3

3 release files

0.0.2

3 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page