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

Django 1.9 'WSGIRequest' object has no attribute 'REQUEST' #90

Closed
darkpixel opened this issue Dec 13, 2015 · 1 comment · Fixed by #92
Closed

Django 1.9 'WSGIRequest' object has no attribute 'REQUEST' #90

darkpixel opened this issue Dec 13, 2015 · 1 comment · Fixed by #92

Comments

@darkpixel
Copy link

ERROR 2015-12-13 11:42:36,721 base 8857 140332125685504 Internal Server Error: /services/timing/record
Traceback (most recent call last):
  File "/home/aaron/.virtualenvs/dna/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/aaron/.virtualenvs/dna/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/aaron/.virtualenvs/dna/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/aaron/.virtualenvs/dna/local/lib/python2.7/site-packages/django_statsd/views.py", line 149, in record
    if 'client' not in request.REQUEST:
AttributeError: 'WSGIRequest' object has no attribute 'REQUEST'
[13/Dec/2015 11:42:37] "POST /services/timing/record HTTP/1.1" 500 8581
@IgorDeedsDirtCheap
Copy link

In short, replace 'request.REQUEST' with 'request' and it should work.

Django 1.9 (?) changed the request and response objects by eliminating wrapped design across the board.

Apparently Django devs eliminated some redundant fields and in this case, request.REQUEST -> request . A similar change is response.error.message -> response.error. I found this error in authomatic package and made a pull request about it.

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

Successfully merging a pull request may close this issue.

2 participants