2014-10-31 75 views
-2

請幫忙解決問題。如何使用wysiwyg編輯器?

我試圖使用所見即所得的編輯器: 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 

回答

0

該錯誤似乎與wsyiwyg-editor沒有任何關係:您在settings.py文件中調用import_module(app),但尚未在該文件中定義或導入該函數。