Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateSyntaxError: {% get_metadata %} needs some path information SHOW When set Debug=False,but set to True, no error out. #38

Open
kingctan opened this issue May 24, 2013 · 4 comments

Comments

@kingctan
Copy link

Traceback (most recent call last):
File "/usr/lib64/python2.6/wsgiref/handlers.py", line 93, in run
self.result = application(self.environ, self.start_response)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 255, in call
response = self.get_response(request)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/core/handlers/base.py", line 178, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/core/handlers/base.py", line 224, in handle_uncaught_exception
return callback(request, *_param_dict)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, *_kwargs)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/views/defaults.py", line 41, in server_error
return http.HttpResponseServerError(template.render(Context({})))
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 830, in render
bit = self.render_node(node, context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 844, in render_node
return node.render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/loader_tags.py", line 124, in render
return compiled_parent._render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 830, in render
bit = self.render_node(node, context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 844, in render_node
return node.render(context)
File "/home/33pinche/33pinche/project/rollyourown/seo/templatetags/seo.py", line 25, in render
raise template.TemplateSyntaxError(msg)
TemplateSyntaxError: {% get_metadata %} needs some path information.
Please use RequestContext with the django.core.context_processors.request context processor.
Or provide a path or object explicitly, eg {% get_metadata for path %} or {% get_metadata for object %}
[24/May/2013 07:45:56] "GET / HTTP/1.1" 500 59
Traceback (most recent call last):
File "/usr/lib64/python2.6/wsgiref/handlers.py", line 93, in run
self.result = application(self.environ, self.start_response)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 255, in call
response = self.get_response(request)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/core/handlers/base.py", line 178, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/core/handlers/base.py", line 224, in handle_uncaught_exception
return callback(request, *_param_dict)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, *_kwargs)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/views/defaults.py", line 41, in server_error
return http.HttpResponseServerError(template.render(Context({})))
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 830, in render
bit = self.render_node(node, context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 844, in render_node
return node.render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/loader_tags.py", line 124, in render
return compiled_parent._render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 830, in render
bit = self.render_node(node, context)
File "/home/33pinche/33pinche/lib/python2.6/site-packages/django/template/base.py", line 844, in render_node
return node.render(context)
File "/home/33pinche/33pinche/project/rollyourown/seo/templatetags/seo.py", line 25, in render
raise template.TemplateSyntaxError(msg)
TemplateSyntaxError: {% get_metadata %} needs some path information.
Please use RequestContext with the django.core.context_processors.request context processor.
Or provide a path or object explicitly, eg {% get_metadata for path %} or {% get_metadata for object %}

@beholderrk
Copy link

context_processors.request is added to TEMPLATE_CONTEXT_PROCESSORS?

@kingctan
Copy link
Author

Yes,I did.

@AMongeMoreno
Copy link

Anything on this?

@cboothe
Copy link

cboothe commented Apr 28, 2015

I had this issue with CBV in Django 1.6.11

Modified the templatetags/seo.py in def render(self, context) on line 20:

    try:
        if 'view' in context:
            target = self.target.resolve(context['view'])
        else:
            target = self.target.resolve(context)

    except VariableDoesNotExist:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants