django-ckeditor:不包括ckeditor js文件

时间:2022-07-04 07:35:34

I'm trying to use the ckeditor package from here: https://github.com/shaunsephton/django-ckeditor . I have followed the directions, but I can't seem to figure out what the path is to include the ckeditor.js file.

我正试图从这里使用ckeditor包:https://github.com/shaunsephton/django-ckeditor。我已按照指示进行操作,但我似乎无法弄清楚包含ckeditor.js文件的路径。

Every time I go to a page with the ckeditor widget/field I get a javascript error because of this:

每次我使用ckeditor小部件/字段进入页面时都会出现javascript错误,原因如下:

Uncaught ReferenceError: CKEDITOR is not defined

未捕获的ReferenceError:未定义CKEDITOR

I did run collectstatic etc..

我确实运行过collectstatic等。

1 个解决方案

#1


1  

Have another look at the docs for serving static files.

再看一下提供静态文件的文档。

If you're in development and using runserver you'll want to add the following to your url conf -

如果您正在开发并使用runserver,则需要将以下内容添加到您的url conf中 -

from django.contrib.staticfiles.urls import staticfiles_urlpatterns

# ... the rest of your URLconf goes here ...

urlpatterns += staticfiles_urlpatterns()

See this section of the docs specifically.

请具体参阅文档的这一部分。

#1


1  

Have another look at the docs for serving static files.

再看一下提供静态文件的文档。

If you're in development and using runserver you'll want to add the following to your url conf -

如果您正在开发并使用runserver,则需要将以下内容添加到您的url conf中 -

from django.contrib.staticfiles.urls import staticfiles_urlpatterns

# ... the rest of your URLconf goes here ...

urlpatterns += staticfiles_urlpatterns()

See this section of the docs specifically.

请具体参阅文档的这一部分。