执行命令时Heroku run python manage.py syncdb
我收到消息:ImportError: No module named tinymce
我使用Django 1.6.2,TinyMCE:django-tinymce == 1.5.2 这就是我安装TinyMCE所做的:
我安装了:pip install django-tinymce
urls.py
from django.conf.urls import patterns, include, url
django.contrib import from admin
admin.autodiscover()
urlpatterns = patterns ('',
url(r'^', include ('app.urls')),
url(r'^tinymce /', include('tinymce.urls')),
url (r'^admin /', include(admin.site.urls)),
)
settings.py
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
'tinymce',
)
STATIC_URL = '/static/'
STATIC_ROOT = 'staticfiles'
STATICFILES_DIRS = (
os.path.join (base_dir, 'static')
)
TEMPLATE_DIRS = (
join(base_dir, 'templates'),
)
TINYMCE_JS_URL = os.path.join(STATIC_URL, 'tinymce/js/tinymce/tinymce.min.js')
TINYMCE_DEFAULT_CONFIG = {
'plugins' :'table, spellchecker, paste, searchreplace"
'theme' : "advanced",
'cleanup_on_startup ':True ,
'custom_undo_redo_levels':10 ,
}
并执行collectstatic
命令。
我无法导入文件models.py模块tinymce:
from tinymce.models import HTMLField
请求帮助。
答案 0 :(得分:0)
与评论中的Dan Hoerst响应类似,在“ requirements.txt”中添加“ django-tinymce”,提交,然后重新部署即可解决问题。