Sitetree throws the following exception when trying to access a specific sitetree in the admin interface:
TemplateSyntaxError at /admin/sitetree/tree/1/
Caught KeyError while rendering: 'request'
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/sitetree/tree/1/
Django Version: 1.3
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.flatpages',
'tagging',
'reversion',
'south',
'sitetree',
'dojango',
'website.blog',
'website.cms']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'dojango.middleware.DojoCollector',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')
Template error:
In template c:\python27\lib\site-packages\sitetree\templates\admin\sitetree\tree\change_form.html, error at line 44
Caught KeyError while rendering: 'request'
34 : <th width="1%">{% trans "Hidden" %}</th>
35 : <th width="1%">{% trans "Menu" %}</th>
36 : <th width="1%">{% trans "Breadcrumbs" %}</th>
37 : <th width="1%">{% trans "Tree" %}</th>
38 : <th width="25%">{% trans "Title" %}</th>
39 : <th width="20%">{% trans "URL" %}</th>
40 : <th>{% trans "Sort order" %}</th>
41 : </tr>
42 : </thead>
43 : <tbody>
44 : {% sitetree_tree from "original.alias" template "admin/sitetree/tree/tree.html" %}
45 : </tbody>
46 : </table>
47 : </div>
48 : <p> </p>
49 : {% endif %}
50 : {% endblock %}
Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Python27\lib\site-packages\django\contrib\admin\options.py" in wrapper
307. return self.admin_site.admin_view(view)(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\utils\decorators.py" in _wrapped_view
93. response = view_func(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\views\decorators\cache.py" in _wrapped_view_func
79. response = view_func(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\contrib\admin\sites.py" in inner
197. return view(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\utils\decorators.py" in _wrapper
28. return bound_func(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\utils\decorators.py" in _wrapped_view
93. response = view_func(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\utils\decorators.py" in bound_func
24. return func(self, *args2, **kwargs2)
File "C:\Python27\lib\site-packages\django\db\transaction.py" in inner
217. res = func(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\contrib\admin\options.py" in change_view
1030. return self.render_change_form(request, context, change=True, obj=obj)
File "C:\Python27\lib\site-packages\django\contrib\admin\options.py" in render_change_form
708. ], context, context_instance=context_instance)
File "C:\Python27\lib\site-packages\django\shortcuts\__init__.py" in render_to_response
20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "C:\Python27\lib\site-packages\django\template\loader.py" in render_to_string
188. return t.render(context_instance)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
123. return self._render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in _render
117. return self.nodelist.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\django\template\loader_tags.py" in render
127. return compiled_parent._render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in _render
117. return self.nodelist.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\django\template\loader_tags.py" in render
127. return compiled_parent._render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in _render
117. return self.nodelist.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\django\template\loader_tags.py" in render
127. return compiled_parent._render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in _render
117. return self.nodelist.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\django\template\loader_tags.py" in render
127. return compiled_parent._render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in _render
117. return self.nodelist.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\django\template\loader_tags.py" in render
64. result = block.nodelist.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\django\template\loader_tags.py" in render
64. result = block.nodelist.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\django\template\loader_tags.py" in render
64. result = block.nodelist.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\django\template\loader_tags.py" in render
64. result = block.nodelist.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\django\template\defaulttags.py" in render
311. return self.nodelist_true.render(context)
File "C:\Python27\lib\site-packages\django\template\base.py" in render
744. bits.append(self.render_node(node, context))
File "C:\Python27\lib\site-packages\django\template\debug.py" in render_node
73. result = node.render(context)
File "C:\Python27\lib\site-packages\sitetree\templatetags\sitetree.py" in render
161. tree_items = sitetree.tree(self.tree_alias, context)
File "C:\Python27\lib\site-packages\sitetree\sitetreeapp.py" in tree
323. tree_alias, sitetree_items = self.init_tree(tree_alias, context)
File "C:\Python27\lib\site-packages\sitetree\sitetreeapp.py" in init_tree
235. sitetree_items = self.get_sitetree(tree_alias)
File "C:\Python27\lib\site-packages\sitetree\sitetreeapp.py" in get_sitetree
78. self.get_tree_current_item(alias)
File "C:\Python27\lib\site-packages\sitetree\sitetreeapp.py" in get_tree_current_item
140. current_url = urlquote(self.global_context['request'].path)
File "C:\Python27\lib\site-packages\django\template\context.py" in __getitem__
60. raise KeyError(key)
Exception Type: TemplateSyntaxError at /admin/sitetree/tree/1/
Exception Value: Caught KeyError while rendering: 'request'
And in case you are wondering I do have django.core.context_processors.request in my TEMPLATE_CONTENT_PROCESSOR.