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.
Metadata
Release files for django-ckeditor 0.0.2
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.2.tar.gz | 5.5 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_ckeditor-0.0.2-py2.6.egg | Legacy Egg format | - | - | Details |
| django_ckeditor-0.0.2-py2.5.egg | Legacy Egg format | - | - | Details |
Total release size: 24.9 kB
Release files / django-ckeditor-0.0.2.tar.gz
| Download URL | django-ckeditor-0.0.2.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
543566132cac26f1dc2fd1d5269a0aea3806257f476400eb81edd44a1bda63d2
|
|
BLAKE2b-256 checksum How to use checksums |
398092485b211dd1c20fe3daf6ba62411122f9a750b748c854495d00f5972308
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_ckeditor-0.0.2-py2.6.egg
| Download URL | django_ckeditor-0.0.2-py2.6.egg |
|---|---|
| Size | 9.7 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
08e9a2696078bed20ae88e0bcf8bcf7a218739dda55efa05d2899125d94ba532
|
|
BLAKE2b-256 checksum How to use checksums |
66ba59d807cc259a07e0ebdd494ec97003094fdf43f017981de29f70bea2fe69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_ckeditor-0.0.2-py2.5.egg
| Download URL | django_ckeditor-0.0.2-py2.5.egg |
|---|---|
| Size | 9.7 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
f190386b2b76b82bc549035e927dfa5d5e19a557dbb5f49a6ab58add62f3a79f
|
|
BLAKE2b-256 checksum How to use checksums |
c2e7fadd5e041f6235bfa4d7e5dd3ea0538b6664b2bd7f874762565fdbd7b241
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |