Django admin CKEditor integration.
Provides a RichTextField and CKEditorWidget utilizing CKEditor with image upload and browsing support included.
Installation
Install or add django-ckeditor to your python path.
Add ckeditor to your INSTALLED_APPS setting.
Copy the media/ckeditor directory into any directory within your media root. You can override the location in your settings (see below).
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/"
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"
Add ckeditor url include to the project’s url.py file:
(r'^ckeditor/', include('ckeditor.urls')),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
Added CKEDITOR_UPLOAD_PREFIX setting. Thanks to chr15m for the input.
0.0.2
Included README.rst in manifest.
0.0.3
More robust PIL import, thanks Dusty Phillips.
Better CKEDITOR_MEDIA_PREFIX setting error.
0.0.4
Include resources, sorry about that.
0.0.5
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)
| File | Size | Uploaded | |
|---|---|---|---|
| django-ckeditor-0.0.5.tar.gz | 1.4 MB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 |