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

'WSGIRequest' object has no attribute 'user_agent' #31

Open
lowegreg opened this issue Oct 12, 2018 · 5 comments
Open

'WSGIRequest' object has no attribute 'user_agent' #31

lowegreg opened this issue Oct 12, 2018 · 5 comments

Comments

@lowegreg
Copy link

If anyone can help with this error I'd be very appreciative. I think I have the settings correct:

INSTALLED_APPS = (
'... Lots of apps',
'django_user_agents'
)

MIDDLEWARE_CLASSES = (
'... Lots of middleware',
'django_user_agents.middleware.UserAgentMiddleware'
)

Traceback (most recent call last): File "/Users/Greg/Development/propel/lib/python2.7/site-packages/django/core/handlers/exception.py", line 42, in inner response = get_response(request) File "/Users/Greg/Development/propel/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response response = self._get_response(request) File "/Users/Greg/Development/propel/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/Users/Greg/Development/propel/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Users/Greg/Development/propel/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view return self.dispatch(request, *args, **kwargs) File "/Users/Greg/Development/propel/lib/python2.7/site-packages/django/views/generic/base.py", line 88, in dispatch return handler(request, *args, **kwargs) File "/Users/Greg/Google Drive/Propel/PropelSurveySolutions/questionnaire/views.py", line 42, in post print self.request.user_agent.is_mobile AttributeError: 'WSGIRequest' object has no attribute 'user_agent'

@goobie
Copy link

goobie commented Dec 21, 2018

Check if AuthenticationMiddleware is missing from your middleware classes.

@Kalightortaio
Copy link

I have the same error, and it's not missing

@meibassam
Copy link

meibassam commented Apr 8, 2020

Also same error here !!
Still bug not fixed ?

@Tamupiwa
Copy link

Tamupiwa commented May 12, 2020

My middleware and installed_apps settings are set but still getting this error as well!

@Mujirin
Copy link

Mujirin commented Oct 13, 2021

I get the same error

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

7 participants
@goobie @Tamupiwa @Mujirin @lowegreg @Kalightortaio @meibassam and others