pip install –user django-ckeditor(if use python3.x , then pip3 install –user django-ckeditor)
INSTALLED_APPS = (
...
'ckeditor',
)
CKEDITOR_UPLOAD_PATH = 'uploads/'
CKEDITOR_RESTRICH_BY_USER = True
CKEDITOR_CONFIGS = {
'default':{
'toolbar':'Advanced',
'width':800,
'height':300,
},
}
urlpatterns = [
...
url('ckeditor/', include('ckeditor_uploader.urls')),
]
from ckeditor.fields import RichTextField
class Post(models.Model):
body = models.TextField()-->change to body = RichTextField()