我关注了installation guide django-tinymce和Using TinyMCE in Django,
在虚拟环境中用pip安装了django-filebrowser,django-grapelli和django-tinymce。
的碎片
settings.py:
INSTALLED_APPS = (
...
'django.contrib.admin',
'tinymce',
)
TINYMCE_JS_URL = MEDIA_URL + 'js/tiny_mce/tiny_mce.js'
TINYMCE_JS_ROOT = MEDIA_ROOT + 'js/tiny_mce'
TINYMCE_DEFAULT_CONFIG = {
'plugins': "table,spellchecker,paste,searchreplace",
'theme': "advanced",
}
urls.py:
urlpatterns = patterns('',
...
(r'^tinymce/', include('tinymce.urls')),
# or (r'^tiny_mce/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': os.path.join(settings.STATIC_ROOT, "admin/js/tiny_mce")},
)
_
import tinymce
Python中的是成功的,但是当我尝试运行django(1.4版)服务器时,我得到了
Error: No module named tinymce
如何解决这个问题?
答案 0 :(得分:2)
听起来你将软件包安装到了错误的virtualenv中。
答案 1 :(得分:0)
尝试
import yourprojectname.tinymce