KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to use the @login_required decorator but I get a 'WSGIRequest' object has no attribute 'user' AttributeError. I have the import statement from django.contrib.auth.decorators import login_required on the top but I still get the error. When I delete @login_required from in front of def profile(request) in my views.py the problem goes away but when I put it in there the problem is still there. Middleware classes from setting.py MIDDLEWARE_CLASSES = ( #~ 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', #~ 'django.middleware.csrf.CsrfViewMiddleware', #~ 'django.contrib.auth.middleware.AuthenticationMiddleware', #~ 'django.contrib.messages.middleware.MessageMiddleware', )
Tags (comma-separated)
Save Edits
Cancel