Добрый день. Перед тем как создавать новую тему испробовал разные мануалы, прочитал доки и просмотрел форум, но проблему не смог решить. А проблема в том что TinyMCE не отображается, просто вообще отсутствует поле для ввода текста.
settings.py
TINYMCE_JS_URL = os.path.join(MEDIA_ROOT, "/js/tiny_mce/tiny_mce_src.js")
TINYMCE_DEFAULT_CONFIG = {
'plugins': "table,paste,searchreplace,advimage,advlink,fullpage,fullscreen,visualchars,preview,media,"
"insertdatatime,directionality,contextmenu,wordc",
'theme_advanced_path_location': "bottom",
'theme_advanced_buttons1': "fullscreen,separator,preview,separator,media,cut,copy,paste,separator,undo,redo,"
"separator,search,replace,separator,code,separator,cleanup,separator,bold,italic,"
"underline,strikethrough,separator,forecolor,backcolor,separator,justifyleft,"
"justifycenter,justifyright,justifyfull,separator,help",
'theme_advanced_buttons2': "removeformat,styleselect,formatselect,fontselect,fontsizeselect,separator,bullist,"
"numlist,outdent,indent,separator,link,unlink,anchor",
'theme_advanced_buttons3': "sub,sup,separator,image,insertdate,inserttime,separator,tablecontrols,separator,hr,"
"advhr,visualaid,separator,charmap,emotions,iespell,flash,separator,print",
'mode': 'textareas',
'theme': 'advanced',
'theme_advanced_toolbar_location': 'top',
'advimage_update_dimensions_onchange': True,
'browsers': 'gecko',
'dialog_type': 'modal',
'object_resizing': True,
'cleanup_on_startup': True,
'forced_root_block': 'p',
'remove_trailing_nbsp': True,
'height': '350',
}
models.py
from tinymce import models as tinymce_models
class News(models.Model):
head = models.CharField('Заголовок', max_length=100)
content = tinymce_models.HTMLField()
urls.py
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^account/', include("account.urls")),
url(r'^', include('cargo.urls', namespace="cargo83")),
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^media/(.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
url(r'^tinymce/', include('tinymce.urls')),
]+static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
admin.py
class NewsAdmin(admin.ModelAdmin):
fieldsets = [
('Заголовок', {'fields': ['head']}),
(None, {'fields': ['content']}),
]
list_display = ('head', 'pub_date')
search_fields = ['head']
prepopulated_fields = {'url': ('head',)}
class Media:
js = (
'%stiny_mce/tiny_mce.js' % settings.STATIC_URL,
)
admin.site.register(News, NewsAdmin)
если не сложно, подскажите в чем ошибка.