如何使用wysiwyg编辑器?

时间:2014-10-31 08:08:47

标签: python django django-cms

请帮助解决问题。

我正在尝试使用wysiwyg-Editor: https://github.com/divio/djangocms-text-ckeditor

models.py:

from django.db import models
from djangocms_text_ckeditor.fields import HTMLField

class News(models.Model):                       
    text = models.HTMLField(
        'Основной текст',
        max_length=50000, 
        blank=False,
    )   

settings.py:

INSTALLED_APPS = (
    'djangocms_text_ckeditor',
   )

尝试使用命令时:

python manage.py schemamigration app_news --auto

I get the following error message:
  File "/home/kalinins/.virtualenvs/blogik5/local/lib/python2.7/site-packages/django/conf/__init__.py", line 49, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/kalinins/.virtualenvs/blogik5/local/lib/python2.7/site-packages/django/conf/__init__.py", line 128, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/home/kalinins/.virtualenvs/blogik5/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/home/kalinins/.virtualenvs/blogik5/blogik5/settings.py", line 149, in <module>
    mod = import_module(app)
NameError: name 'import_module' is not defined

1 个答案:

答案 0 :(得分:0)

该错误似乎与wsyiwyg-editor无关:您在settings.py文件中调用import_module(app),但尚未在该文件中定义或导入该函数。