Unfortunately, I'm at a loss as to what, exactly, is the problem here.
---
Traceback (most recent call last):
File "/home/ohgoditb/django_src/django/core/handlers/base.py",
line 74, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/ohgoditb/django_src/django/views/generic/
date_based.py", line 333, in object_detail
}, context_processors)
File "/home/ohgoditb/django_src/django/template/context.py", line
97, in __init__
self.update(processor(request))
File "/home/ohgoditb/django_src/django/core/
context_processors.py", line 17, in auth
return {
AttributeError: 'WSGIRequest' object has no attribute 'user'
---
I've searched Google and the Groups archive but have found nothing
that works.
Perhaps someone on the list has a better idea of what's going on?
I've got the following in settings.py:
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.auth",
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
)
Thanks in advance for any ideas!
-Tyson
Sorry, I'm stumped. :-/
Couple things to try if you're in a debugging mood:
After line 11 in django/contrib/admin/middleware.py:
request.__class__.user = LazyUser()
+ print 'Middleware:', request.user
Add that line to see if it's actually being set.
Now as the first line in whatever view this is happening in, do the
same thing:
def index_view(request):
+ print 'View:', request.user
This should at least narrow down where in the code request.user is
being obliterated...
If that's you case, comment it out in your settings.py file:
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
# "django.core.context_processors.auth",
)
On Jan 5, 5:40 am, "Brian Beck" <exo...@gmail.com> wrote:
> It would seem that something is happening between the authentication
> middleware setting request.__class__.userand the context processor
> reading it.
>
> Couple things to try if you're in a debugging mood:
>
> After line 11 in django/contrib/admin/middleware.py:
> request.__class__.user= LazyUser()