0

I can't get RequestContext to work:

Traceback:
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/views/generic/simple.py" in direct_to_template
  26.     c = RequestContext(request, dictionary)
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/template/context.py" in __init__
  176.             self.update(processor(request))

Exception Type: TypeError at /
Exception Value: 'module' object is not callable

I added it to my template context processors:

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.request',
)

What else could I be missing?

Thanks for your ideas!

Nick B
  • 9,267
  • 17
  • 64
  • 105
  • 1
    apparently you have the error elsewhere in the code. Is that the entire stacktrace ? One thing I would do is, go through INSTALLED)APPS one by one and figure out which app is causing the error ? – karthikr Oct 28 '13 at 22:13
  • Yes that is the entire traceback.. Wow dont even know how to approach this one, sadly.. – Nick B Oct 28 '13 at 22:19
  • you are using a builtin or an imported module name as the view name, or seomthing like that. It would be impossible to "guess" what that is – karthikr Oct 28 '13 at 22:20
  • Okay, thanks for the suggestion. But what does that mean exactly? You mean that my view name is the same as a module name? Thanks for your ideas – Nick B Oct 28 '13 at 22:23
  • Yeah. It may be the view name, but not limited to views, but any methods (helper methods, etc...) – karthikr Oct 28 '13 at 22:24
  • Oh wait. Removing `django.contrib.staticfiles` solves the problem. Any ideas why? Thanks! – Nick B Oct 28 '13 at 22:31
  • Well, it could be some conflicting imports. Sorry I would not be able to exactly tell you why this is happening – karthikr Oct 28 '13 at 22:34
  • @karthikr adn @Nick-B I was in the same error. My situation was that I tried install `django-suit` and this package did require that I add `'django.template.context_processors'` but for Django 1.9.5 is not necessary. I remove `'django.template.context_processors'` and all works fine. – bgarcial May 02 '16 at 12:56

0 Answers0