执行命令时: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
请帮助。
2条答案
按热度按时间kq4fsx7k1#
类似于Dan Hoerst在评论中的回应,将“django-tinymce”添加到requirements.txt,提交,然后重新部署解决了这个问题。
ar7v8xwq2#
对于我运行pip安装django-tinymce工程!