S
S
Sergey Nizhny Novgorod2016-09-20 07:19:49
Django
Sergey Nizhny Novgorod, 2016-09-20 07:19:49

Why doesn't the image upload button appear in Django's ckeditor?

Hello.
I put ckeditor in django - it appeared, everything works, everything is super. I decided to add image loading, I did everything according to the instructions: https://github.com/django-ckeditor/django-ckeditor... , but we poke on the image icon in ckeditor and there is neither a tab nor a download button.
What I did:
1) Installed via pip and added to applications

INSTALLED_APPS = [

    'ckeditor',
    'ckeditor_uploader',

]

2) Installed configs
# Ckeditor_Jquery

CKEDITOR_JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'

# Ckeditor_Upload_files

CKEDITOR_UPLOAD_PATH = "uploads/"

CKEDITOR_IMAGE_BACKEND = 'pillow'

# Ckeditor_config

CKEDITOR_CONFIGS = {
    'default': {
        'width': '100%',
        'height': 200,
        "removePlugins": "stylesheetparser",
        'toolbar': 'Custom',
        'toolbar_Custom': [
            ['Bold', '-', 'Italic', '-', 'Underline', '-', 'Blockquote'],
        ]
    },
    'admin_panel': {
        'width': 800,
        'height': 500,
        'toolbar': 'Custom',
        'toolbar_Custom': [
            ['Bold', 'Italic', 'Underline'],
            ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Format', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
            ['Link', 'Unlink', 'Blockquote', 'Image',],
            ['RemoveFormat', 'Source']
        ]
    }    
}

3) Checked media paths
STATIC_URL = '/static/'

STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)

STATIC_ROOT = os.path.join(BASE_DIR, "/static/")

MEDIA_ROOT = '/faceset/media/'

MEDIA_URL = '/media/'

4) Added to urls.py
urlpatterns = [
   ...
    url(r'^ckeditor/', include('ckeditor_uploader.urls')), #загрузка в editor
    ...
]

And there is no download button. Do not tell me where I went wrong?
_____
I changed the RichTextField field to RichTextUploadingField - it worked on my computer (in LAN). The following error appeared on the dev server: take.ms/Ad1gb
On the dev environment, the only thing that is different is the root:
STATIC_URL = '/static/'

MEDIA_URL = '/media/'

STATIC_ROOT = os.path.join(BASE_DIR, "static")

MEDIA_ROOT = os.path.join(BASE_DIR, "media")

STATICFILES_DIRS = (
)

Do not tell me what is the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2016-09-20
@Terras

In the model, change RichTextField to RichTextUploadingField.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question