﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
5193	TinyMCE problem	stephanerufer@…	Adrian Holovaty	"i tried installing tinymce with django, but i seem to have a problem with the js import. i tried to google of another tutorial...but alas nothing seemed to work. in your tutorial (http://code.djangoproject.com/wiki/AddWYSIWYGEditor) there are paths that i do not have, idk if i'm looking in the wrong direction...i am sort of new to django. This is the error i get:


Template error

In template c:\python25\lib\site-packages\django\contrib\admin\templates\admin\change_form.html, error at line 5
Caught an exception while rendering: expected string or buffer
1 	{% extends ""admin/base_site.html"" %}
2 	{% load i18n admin_modify adminmedia %}
3 	{% block extrahead %}{{ block.super }}
4 	<script type=""text/javascript"" src=""../../../jsi18n/""></script>
5 	{% for js in javascript_imports %}{% include_admin_script js %}{% endfor %}
6 	{% endblock %}
7 	{% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %}
8 	{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}
9 	{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
10 	{% block userlinks %}<a href=""../../../doc/"">{% trans 'Documentation' %}</a> / <a href=""../../../password_change/"">{% trans 'Change password' %}</a> / <a href=""../../../logout/"">{% trans 'Log out' %}</a>{% endblock %}
11 	{% block breadcrumbs %}{% if not is_popup %}
12 	<div class=""breadcrumbs"">
13 	<a href=""../../../"">{% trans ""Home"" %}</a> &rsaquo;
14 	<a href=""../"">{{ opts.verbose_name_plural|capfirst|escape }}</a> &rsaquo;
15 	{% if add %}{% trans ""Add"" %} {{ opts.verbose_name|escape }}{% else %}{{ original|truncatewords:""18""|escape }}{% endif %}
Traceback (innermost last)
Switch to copy-and-paste view

    * c:\Python25\lib\site-packages\django\template\__init__.py in render_node
       747.
       748. def render_node(self, node, context):
       749. return node.render(context)
       750.
       751. class DebugNodeList(NodeList):
       752. def render_node(self, node, context):
       753. try:
       754. result = node.render(context) ...
       755. except TemplateSyntaxError, e:
       756. if not hasattr(e, 'source'):
       757. e.source = node.source
       758. raise
       759. except Exception, e:
       760. from sys import exc_info
      ▶ Local vars
      Variable 	Value
      context 	
      [{'forloop': {'parentloop': {}, 'last': True, 'counter': 5, 'revcounter0': 0, 'revcounter': 1, 'counter0': 4, 'first': False}, u'js': ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')}, {'block': <Block Node: extrahead. Contents: [<Variable Node: block.super>, <Text Node: ' <script type=""text/javas'>, <For Node: for js in javascript_imports, tail_len: 1>, <Text Node: ' '>]>}, {}, {'form_url': '', 'ordered_objects': [], 'has_file_field': False, 'has_change_permission': True, 'content_type_id': 8L, 'first_form_field_id': 'id_question', 'bound_field_sets': [<django.contrib.admin.views.main.AdminBoundFieldSet object at 0x0180ED70>, <django.contrib.admin.views.main.AdminBoundFieldSet object at 0x0180EAD0>], 'auto_populated_fields': [], 'add': False, 'change': True, 'javascript_imports': ['js/core.js', 'js/admin/RelatedObjectLookups.js', 'js/calendar.js', 'js/admin/DateTimeShortcuts.js', ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')], 'opts': <Options for Poll>, 'inline_related_objects': [<RelatedObject: polls:choice related to poll>], 'has_absolute_url': False, 'has_delete_permission': True}, {'MEDIA_URL': ''}, {'LANGUAGES': (('ar', 'Arabic'), ('bn', 'Bengali'), ('bg', 'Bulgarian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('hr', 'Croatian'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ko', 'Korean'), ('kn', 'Kannada'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt', 'Portugese'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'en-us'}, {}, {'perms': <django.core.context_processors.PermWrapper object at 0x0180E650>, 'messages': [], 'user': <User: django>}, {'is_popup': False, 'original': <Poll: hey>, 'object_id': u'4', 'form': {'error_dict': {}, 'edit_inline': True, '_inline_collections': None, 'manipulator': <django.db.models.manipulators.ChangeManipulator object at 0x0181BFB0>, 'order_objects': [], 'data': {'choice.0.choice': '', 'choice.0.votes': None, 'pub_date_date': '2007-08-15', 'choice.0.id': None, 'question': u'hey', 'id': 4L, 'pub_date_time': '15:55:09'}, 'original': <Poll: hey>}, 'title': u'Change poll'}]
      e 	
      TypeError('expected string or buffer',)
      exc_info 	
      <built-in function exc_info>
      node 	
      <For Node: for js in javascript_imports, tail_len: 1>
      self 	
      [<Variable Node: block.super>, <Text Node: ' <script type=""text/javas'>, <For Node: for js in javascript_imports, tail_len: 1>, <Text Node: ' '>]
      wrapped 	
      TemplateSyntaxError('Caught an exception while rendering: expected string or buffer',)
    * c:\Python25\lib\site-packages\django\template\defaulttags.py in render
       127. }
       128. if unpack:
       129. # If there are multiple loop variables, unpack the item into them.
       130. context.update(dict(zip(self.loopvars, item)))
       131. else:
       132. context[self.loopvars[0]] = item
       133. for node in self.nodelist_loop:
       134. nodelist.append(node.render(context)) ...
       135. if unpack:
       136. # The loop variables were pushed on to the context so pop them
       137. # off again. This is necessary because the tag lets the length
       138. # of loopvars differ to the length of each set of items and we
       139. # don't want to leave any vars from the previous loop on the
       140. # context.
      ▶ Local vars
      Variable 	Value
      context 	
      [{'forloop': {'parentloop': {}, 'last': True, 'counter': 5, 'revcounter0': 0, 'revcounter': 1, 'counter0': 4, 'first': False}, u'js': ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')}, {'block': <Block Node: extrahead. Contents: [<Variable Node: block.super>, <Text Node: ' <script type=""text/javas'>, <For Node: for js in javascript_imports, tail_len: 1>, <Text Node: ' '>]>}, {}, {'form_url': '', 'ordered_objects': [], 'has_file_field': False, 'has_change_permission': True, 'content_type_id': 8L, 'first_form_field_id': 'id_question', 'bound_field_sets': [<django.contrib.admin.views.main.AdminBoundFieldSet object at 0x0180ED70>, <django.contrib.admin.views.main.AdminBoundFieldSet object at 0x0180EAD0>], 'auto_populated_fields': [], 'add': False, 'change': True, 'javascript_imports': ['js/core.js', 'js/admin/RelatedObjectLookups.js', 'js/calendar.js', 'js/admin/DateTimeShortcuts.js', ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')], 'opts': <Options for Poll>, 'inline_related_objects': [<RelatedObject: polls:choice related to poll>], 'has_absolute_url': False, 'has_delete_permission': True}, {'MEDIA_URL': ''}, {'LANGUAGES': (('ar', 'Arabic'), ('bn', 'Bengali'), ('bg', 'Bulgarian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('hr', 'Croatian'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ko', 'Korean'), ('kn', 'Kannada'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt', 'Portugese'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'en-us'}, {}, {'perms': <django.core.context_processors.PermWrapper object at 0x0180E650>, 'messages': [], 'user': <User: django>}, {'is_popup': False, 'original': <Poll: hey>, 'object_id': u'4', 'form': {'error_dict': {}, 'edit_inline': True, '_inline_collections': None, 'manipulator': <django.db.models.manipulators.ChangeManipulator object at 0x0181BFB0>, 'order_objects': [], 'data': {'choice.0.choice': '', 'choice.0.votes': None, 'pub_date_date': '2007-08-15', 'choice.0.id': None, 'question': u'hey', 'id': 4L, 'pub_date_time': '15:55:09'}, 'original': <Poll: hey>}, 'title': u'Change poll'}]
      i 	
      4
      item 	
      ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')
      len_values 	
      5
      node 	
      <django.template.SimpleNode object at 0x01815950>
      nodelist 	
      [u'<script type=""text/javascript"" src=""/media/js/core.js""></script>', u'<script type=""text/javascript"" src=""/media/js/admin/RelatedObjectLookups.js""></script>', u'<script type=""text/javascript"" src=""/media/js/calendar.js""></script>', u'<script type=""text/javascript"" src=""/media/js/admin/DateTimeShortcuts.js""></script>']
      parentloop 	
      {}
      self 	
      <For Node: for js in javascript_imports, tail_len: 1>
      unpack 	
      False
      values 	
      ['js/core.js', 'js/admin/RelatedObjectLookups.js', 'js/calendar.js', 'js/admin/DateTimeShortcuts.js', ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')]
    * c:\Python25\lib\site-packages\django\template\__init__.py in render
       865.
       866. class SimpleNode(Node):
       867. def __init__(self, vars_to_resolve):
       868. self.vars_to_resolve = vars_to_resolve
       869.
       870. def render(self, context):
       871. resolved_vars = [resolve_variable(var, context) for var in self.vars_to_resolve]
       872. return func(*resolved_vars) ...
       873.
       874. compile_func = curry(generic_tag_compiler, params, defaults, getattr(func, ""_decorated_function"", func).__name__, SimpleNode)
       875. compile_func.__doc__ = func.__doc__
       876. self.tag(getattr(func, ""_decorated_function"", func).__name__, compile_func)
       877. return func
 878.
      ▶ Local vars
      Variable 	Value
      context 	
      [{'forloop': {'parentloop': {}, 'last': True, 'counter': 5, 'revcounter0': 0, 'revcounter': 1, 'counter0': 4, 'first': False}, u'js': ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')}, {'block': <Block Node: extrahead. Contents: [<Variable Node: block.super>, <Text Node: ' <script type=""text/javas'>, <For Node: for js in javascript_imports, tail_len: 1>, <Text Node: ' '>]>}, {}, {'form_url': '', 'ordered_objects': [], 'has_file_field': False, 'has_change_permission': True, 'content_type_id': 8L, 'first_form_field_id': 'id_question', 'bound_field_sets': [<django.contrib.admin.views.main.AdminBoundFieldSet object at 0x0180ED70>, <django.contrib.admin.views.main.AdminBoundFieldSet object at 0x0180EAD0>], 'auto_populated_fields': [], 'add': False, 'change': True, 'javascript_imports': ['js/core.js', 'js/admin/RelatedObjectLookups.js', 'js/calendar.js', 'js/admin/DateTimeShortcuts.js', ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')], 'opts': <Options for Poll>, 'inline_related_objects': [<RelatedObject: polls:choice related to poll>], 'has_absolute_url': False, 'has_delete_permission': True}, {'MEDIA_URL': ''}, {'LANGUAGES': (('ar', 'Arabic'), ('bn', 'Bengali'), ('bg', 'Bulgarian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('hr', 'Croatian'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ko', 'Korean'), ('kn', 'Kannada'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt', 'Portugese'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'en-us'}, {}, {'perms': <django.core.context_processors.PermWrapper object at 0x0180E650>, 'messages': [], 'user': <User: django>}, {'is_popup': False, 'original': <Poll: hey>, 'object_id': u'4', 'form': {'error_dict': {}, 'edit_inline': True, '_inline_collections': None, 'manipulator': <django.db.models.manipulators.ChangeManipulator object at 0x0181BFB0>, 'order_objects': [], 'data': {'choice.0.choice': '', 'choice.0.votes': None, 'pub_date_date': '2007-08-15', 'choice.0.id': None, 'question': u'hey', 'id': 4L, 'pub_date_time': '15:55:09'}, 'original': <Poll: hey>}, 'title': u'Change poll'}]
      func 	
      <function include_admin_script at 0x01689370>
      resolved_vars 	
      [('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')]
      self 	
      <django.template.SimpleNode object at 0x01815950>
      var 	
      u'js'
    * c:\Python25\lib\site-packages\django\contrib\admin\templatetags\admin_modify.py in include_admin_script
        26.
        27. {% include_admin_script ""js/calendar.js"" %}
        28.
        29. could return::
        30.
        31. <script type=""text/javascript"" src=""/media/admin/js/calendar.js"">
        32. """"""
        33. if not absolute_url_re.match(script_path): ...
        34. script_path = '%s%s' % (settings.ADMIN_MEDIA_PREFIX, script_path)
        35. return u'<script type=""text/javascript"" src=""%s""></script>' % script_path
        36. include_admin_script = register.simple_tag(include_admin_script)
        37.
        38. def submit_row(context):
        39. opts = context['opts']
      ▶ Local vars 



Thanks for the help --> i have the newest and greatest django version on a windows box running xampp with apache 2.2.3"		closed	contrib.admin	dev		invalid	tinymce		Unreviewed	0	0	0	0	0	0
