Skip to content Skip to sidebar Skip to footer

Django Error : 'wsgirequest' Object Has No Attribute 'user'

I'm practicing django. Before I met this error message that is 'WSGIRequest' object has no attribute 'user' , I restart project and it was disappeared. Today, I met this error m

Solution 1:

request.user is added by AuthenticationMiddleware. As you can easily see from the error message, you don't have that loaded.

As noted by @Sergey Gornostaev, your settings are wrong. If you want to provide a list of middleware classes, use MIDDLEWARE_CLASSES instead of just MIDDLEWARE.

Solution 2:

Change in settings.py MIDDLEWARE to MIDDLEWARE_CLASSES.

Post a Comment for "Django Error : 'wsgirequest' Object Has No Attribute 'user'"