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

Update compat.py for django 1.7 compatibility #1044

Closed
wants to merge 1 commit into from

Conversation

chicagobuss
Copy link
Contributor

Fix for django 1.7 error:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/graphite/webapp/graphite/render/views.py", line 207, in renderView
    response = HttpResponse(content=result, mimetype='application/json')
  File "/opt/graphite/webapp/graphite/compat.py", line 10, in __init__
    super(ContentTypeMixin, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/http/response.py", line 318, in __init__
    super(HttpResponse, self).__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'mimetype'

Based on findings from this thread where "mimetype" has once again been swapped out in favor of "control_type" in 1.7: caffeinehit/django-oauth2-provider#77

Fix for django 1.7 error:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/graphite/webapp/graphite/render/views.py", line 207, in renderView
    response = HttpResponse(content=result, mimetype='application/json')
  File "/opt/graphite/webapp/graphite/compat.py", line 10, in __init__
    super(ContentTypeMixin, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/http/response.py", line 318, in __init__
    super(HttpResponse, self).__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'mimetype'
@chicagobuss
Copy link
Contributor Author

any new on this? still pretty annoying :(

@brutasse
Copy link
Member

There was no swap with Django 1.7. Looking at the code I don't see the offending line either in master or in 0.9.x. Which version are you running?

@obfuscurity
Copy link
Member

No updates or responses to @brutasse's question, closing.

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 this pull request may close these issues.

3 participants