这是我的设置:
网址.py
....
url(r'^tinymce/', include('tinymce.urls')),
....
设置.py
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
TINYMCE_DEFAULT_CONFIG = {
"theme_advanced_buttons1": ("formatselect,"
"separator, bold, italic, "
"underline, strikethrough, separator,"
"justifyleft,justifycenter, justifyright,"
"justifyfull, separator, bullist, numlist,"
"separator, link, code")
}
TINYMCE_SPELLCHECKER = False
TINYMCE_COMPRESSOR = False
TINYMCE_JS_URL = '/static/js/tiny_mce/tiny_mce.js'
TINYMCE_JS_ROOT = '/static/js/tiny_mce'
my_template.html
{% extends '_layout.html' %}
{% block extra_head %}
{{ form.media }}
{% endblock %}
表格.py
class VenueForm(ModelForm):
.....
class Meta:
widgets = {
'description': TinyMCE(attrs={'cols': 100, 'rows': 10}),
}
我一直在搜索文档和其他 SO 线程,我认为我设置正确。但是,我收到了错误:
ReferenceError: django is not defined
}(django.jQuery));
这是static/django_tinymce/init_tinymce.js
. 我所有的资源都加载正常,控制台中没有 404 错误我错过了什么?在过去的两个小时里,我一直在为此苦苦挣扎。谢谢