【问题标题】:How to deal with staticfiles module in an old version of django?如何处理旧版本 django 中的 staticfiles 模块?
【发布时间】:2015-09-16 14:32:09
【问题描述】:

我想部署使用django 1.2.5 开发的应用程序,我有一个所需软件包的列表,我已经安装了它们,当我启动http://localhost:8000 时出现以下错误:

from ckeditor.widgets import CKEditorWidget
  File "build\bdist.win32\egg\ckeditor\widgets.py", line 4, in <module>
ImportError: No module named staticfiles.templatetags.staticfiles

我安装了一个名为:django-ckeditor 4.4.8 的包,这似乎是根本原因,我看到了ckeditor\widgets.py 文件并试图修改它但没有机会(因为在一个 egg 文件中编译):

#ckeditor\widgets.py

from django.contrib.staticfiles.templatetags.staticfiles import static
    ...
        try:
            js += (
                    static('ckeditor/ckeditor/ckeditor.js'),
                    static('ckeditor/ckeditor-init.js'),
                    )

此问题的任何解决方法?

【问题讨论】:

    标签: python django django-ckeditor


    【解决方案1】:

    首先,您应该真正将您的应用升级到更高版本的 Django。 Django 1.2 已经超过 5 年了,并且多年没有收到安全更新。

    看起来导致您出现问题的行是reverted in master。所以你可以尝试之前的 4.4.7 版本或者等待下一个版本。

    【讨论】:

    • 其实这就是重点,但我应该先在本地环境中运行它
    猜你喜欢
    • 2018-06-17
    • 2016-08-28
    • 2011-05-01
    • 2020-06-21
    • 2020-11-14
    • 1970-01-01
    • 1970-01-01
    • 2021-01-06
    • 2011-03-28
    相关资源
    最近更新 更多