Opened 17 years ago
Closed 17 years ago
#5193 closed (invalid)
TinyMCE problem
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | tinymce | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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> ›
14 <a href="../">{{ opts.verbose_name_plural|capfirst|escape }}</a> ›
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.
- def render_node(self, node, context):
- return node.render(context) 750.
- class DebugNodeList(NodeList):
- def render_node(self, node, context):
- try:
- result = node.render(context) ...
- except TemplateSyntaxError, e:
- if not hasattr(e, 'source'):
- e.source = node.source
- raise
- except Exception, e:
- 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
- }
- if unpack:
- # If there are multiple loop variables, unpack the item into them.
- context.update(dict(zip(self.loopvars, item)))
- else:
- context[self.loopvars[0]] = item
- for node in self.nodelist_loop:
- nodelist.append(node.render(context)) ...
- if unpack:
- # The loop variables were pushed on to the context so pop them
- # off again. This is necessary because the tag lets the length
- # of loopvars differ to the length of each set of items and we
- # don't want to leave any vars from the previous loop on the
- # context.
- c:\Python25\lib\site-packages\django\template\init.py in render
865.
- class SimpleNode(Node):
- def init(self, vars_to_resolve):
- self.vars_to_resolve = vars_to_resolve 869.
- def render(self, context):
- resolved_vars = [resolve_variable(var, context) for var in self.vars_to_resolve]
- return func(*resolved_vars) ... 873.
- compile_func = curry(generic_tag_compiler, params, defaults, getattr(func, "_decorated_function", func).name, SimpleNode)
- compile_func.doc = func.doc
- self.tag(getattr(func, "_decorated_function", func).name, compile_func)
- 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.
- {% include_admin_script "js/calendar.js" %} 28.
- could return:: 30.
- <script type="text/javascript" src="/media/admin/js/calendar.js">
- """
- if not absolute_url_re.match(script_path): ...
- script_path = '%s%s' % (settings.ADMIN_MEDIA_PREFIX, script_path)
- return u'<script type="text/javascript" src="%s"></script>' % script_path
- include_admin_script = register.simple_tag(include_admin_script) 37.
- def submit_row(context):
- opts = contextopts
▶ 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
Please ask support questions on the django-users mailing list.
This Trac is for bug reports only (and errors in wiki pages, since they can be edited by anybody, aren't typically classified as bugs). The mailing list should be able to give you some help, though, so please try there.