Django-ckeditor造型

时间:2015-10-17 16:20:12

标签: django django-ckeditor

CONFIG中有一个选项:

CKEDITOR_CONFIGS = {
    'default': {
        'skin': 'moono',
        # 'skin': 'office2013',
        ...

但实际上我甚至无法切换到office2013主题,我只能获得白色块。

有没有办法启用其他主题?

2 个答案:

答案 0 :(得分:2)

django-ckeditor只与月亮皮一起发货。你需要下载你想要的皮肤,并把它放在你的静态目录上:

%STATIC_DIR%/ckeditor/ckeditor/skins/

答案 1 :(得分:0)

第一级:      您必须使用office2013主题下载CkEditor。

第二级:

models.py

class Post(models.Model):
    title = models.CharField(max_length=500, verbose_name=_('Title'), blank=True)
    message = models.TextField(max_length=50000, verbose_name=_('Message'), blank=True)

admin.py

class PostModelAdmin(admin.ModelAdmin):
    formfield_overrides = { models.TextField: {'widget': forms.Textarea(attrs={'class':'ckeditor'})}, }

    class Media:
        js = ('ckeditor/ckeditor.js',) # The , at the end of this list IS important.
        css = {
            'all': ('ckeditor/contents.css',)
        }

admin.site.register(Post, PostModelAdmin)