django - Template syntax error with RequestContext(request)) -
the following block of code throwing error , can't figure out why -- haven't changed @ - error started happening:
def product_feed(request): """ return site activity friends, etc. """ if request.user.is_authenticated(): return httpresponseredirect("/about/what_next/") else: return render_to_response("homepage.html", {}, context_instance=requestcontext(request))
it's last line returns render_to_response problem occurs.
error is:
exception type: syntaxerror @ / exception value: invalid syntax (views.py, line 804)
screenshot shows issue.
traceback:
traceback: file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) file "/users/nb/desktop/store/views.py" in product_feed 261. return render_to_response("homepage.html", {}, context_instance=requestcontext(request)) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/shortcuts/__init__.py" in render_to_response 20. return httpresponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/loader.py" in render_to_string 176. return t.render(context_instance) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/base.py" in render 140. return self._render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/test/utils.py" in instrumented_test_render 62. return self.nodelist.render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/base.py" in render 823. bit = self.render_node(node, context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/debug.py" in render_node 74. return node.render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/loader_tags.py" in render 123. return compiled_parent._render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/test/utils.py" in instrumented_test_render 62. return self.nodelist.render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/base.py" in render 823. bit = self.render_node(node, context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/debug.py" in render_node 74. return node.render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/loader_tags.py" in render 123. return compiled_parent._render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/test/utils.py" in instrumented_test_render 62. return self.nodelist.render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/base.py" in render 823. bit = self.render_node(node, context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/debug.py" in render_node 74. return node.render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/defaulttags.py" in render 281. return nodelist.render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/base.py" in render 823. bit = self.render_node(node, context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/debug.py" in render_node 74. return node.render(context) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/template/defaulttags.py" in render 411. url = reverse(view_name, args=args, kwargs=kwargs, current_app=context.current_app) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse 476. return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/core/urlresolvers.py" in _reverse_with_prefix 363. possibilities = self.reverse_dict.getlist(lookup_view) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse_dict 276. self._populate() file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/core/urlresolvers.py" in _populate 253. name in pattern.reverse_dict: file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse_dict 276. self._populate() file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/core/urlresolvers.py" in _populate 265. lookups.appendlist(pattern.callback, (bits, p_pattern, pattern.default_args)) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/core/urlresolvers.py" in callback 216. self._callback = get_callable(self._callback_str) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/utils/functional.py" in wrapper 27. result = func(*args) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/core/urlresolvers.py" in get_callable 92. lookup_view = getattr(import_module(mod_name), func_name) file "/users/nb/desktop/myenv2/lib/python2.7/site-packages/django/utils/importlib.py" in import_module 35. __import__(name) exception type: syntaxerror @ / exception value: invalid syntax (views.py, line 804)
Comments
Post a Comment