Django-dash备忘录和新闻插件错误

时间:2014-07-01 18:44:43

标签: python django plugins

我正在尝试通过以下方式设置django-dash演示:https://github.com/barseghyanartur/django-dash

我手动安装了django-dash的所有依赖项(因为工作计算机/代理问题),并且据说也成功安装了django-dash。在本教程之后,我开始为我的应用程序的INSTALLED_APPS设置添加几个布局和插件。当我添加所有插件时,没有问题,除了星号中的插件 - 备忘录和新闻。

INSTALLED_APPS = (
    # ...
    'dash',
    'dash.contrib.layouts.android',
    'dash.contrib.layouts.bootstrap2',
    'dash.contrib.layouts.windows8',
    'dash.contrib.plugins.dummy',
    'dash.contrib.plugins.image',
    **'dash.contrib.plugins.memo',
    'dash.contrib.plugins.news',**
    'dash.contrib.plugins.rss_feed',
    'dash.contrib.plugins.url',
    'dash.contrib.plugins.video',
    'dash.contrib.plugins.weather',
    # ...
)

这是我收到的错误消息。我想也许文件丢失但是当我检查文件夹时,autoreload.py等都在那里。可能是什么问题?

Unhandled exception in thread started by <function wrapper at 0x0208ECB0>
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 93, in w
rapper
    fn(*args, **kwargs)
  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.
py", line 101, in inner_run
    self.validate(display_num_errors=True)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 310,
 in validate
    num_errors = get_validation_errors(s, app)
  File "C:\Python27\lib\site-packages\django\core\management\validation.py", lin
e 34, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 196, in
 get_app_errors
    self._populate()
  File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 75, in
_populate
    self.load_app(app_name, True)
  File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 99, in
load_app
    models = import_module('%s.models' % app_name)
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in im
port_module
    __import__(name)
  File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\models.py
", line 21, in <module>
    class DashboardSettings(models.Model):
  File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\models.py
", line 32, in DashboardSettings
    layout_uid = models.CharField(_("Layout"), max_length=25, choices=get_regist
ered_layouts())
  File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\base.py",
 line 1491, in get_registered_layouts
    ensure_autodiscover()
  File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\base.py",
 line 1432, in ensure_autodiscover
    autodiscover()
  File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\discover.
py", line 33, in autodiscover
    do_discover(PLUGINS_MODULE_NAME)
  File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\discover.
py", line 27, in do_discover
    __import__('{0}.{1}'.format(app, module_name))
  File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\contrib\p
lugins\memo\dash_plugins.py", line 10, in <module>
    from dash.contrib.plugins.memo.forms import MemoForm, TinyMCEMemoForm
  File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\contrib\p
lugins\memo\forms.py", line 9, in <module>
    from tinymce.widgets import TinyMCE
  File "C:\Python27\lib\site-packages\django_tinymce-1.5.2-py2.7.egg\tinymce\wid
gets.py", line 10, in <module>
    import tinymce.settings
  File "C:\Python27\lib\site-packages\django_tinymce-1.5.2-py2.7.egg\tinymce\set
tings.py", line 16, in <module>
    JS_ROOT = getattr(settings, 'TINYMCE_JS_ROOT',os.path.join(settings.STATIC_R
OOT, 'tiny_mce'))
  File "C:\Python27\lib\ntpath.py", line 64, in join
    result_drive, result_path = splitdrive(path)
  File "C:\Python27\lib\ntpath.py", line 94, in splitdrive
    if p[1:2] == ':':
TypeError: 'NoneType' object has no attribute '__getitem__'

1 个答案:

答案 0 :(得分:0)

正如文档(最近)所述,django-tinymcenews插件需要memo个包。

不幸的是,django-tinymce还没有与Python 3兼容(但是,有一个python 3兼容分支,其目的是有一天成为主人)。

如果你使用的是Python 3,你应该简单地使用不带django-tinymce的TinyMCE(无论如何都不是很有效)。