1 year ago
#389095
boyenec
Django ck-editor can't add extra plugin
I am trying to add an extra plugin but I can't. When I am inspecting my console it's saying can't load the javascript file. Here is my code:
error which I am getting in my console but I have youtube plugin in my plugins folder:
Loading failed for the <script> with source “http://127.0.0.1:8000/static/ckeditor/ckeditor/plugins/youtube/plugin.js?t=LAHF”.
settings.py
STATIC_ROOT = 'var/static'
CKEDITOR_UPLOAD_PATH = "uploads/"
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'full',
'extraPlugins': ','.join([
'youtube',
]),
},
}
urls.py
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('ckeditor/', include('ckeditor_uploader.urls')),
]
models.py
class Blog(models.Model):
blog_title = models.CharField(max_length=255)
blog_body = RichTextUploadingField(blank=True, null=True,)
I also tried this but didn't work:
blog_body = RichTextUploadingField(
config_name='default',
# CKEDITOR.config.extraPlugins:
extra_plugins=['youtube'],
# CKEDITOR.plugins.addExternal(...)
external_plugin_resources=[(
'youtube',
'var/static/ckeditor/ckeditor/plugins/youtube/',
'plugin.js',
)],
)
javascript
python-3.x
django
ckeditor
0 Answers
Your Answer