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

__init__() got an unexpected keyword argument 'mimetype' #5

Open
yakovlev-andrey opened this issue Oct 30, 2014 · 1 comment
Open

Comments

@yakovlev-andrey
Copy link

Environment:

Request Method: POST
Request URL: https://g-selenium-02/admin/lk/zoho/

Django Version: 1.7.1
Python Version: 2.7.5
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'djcelery',
'lk',
'admin_exporter')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback:
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/usr/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/usr/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  3.                 response = view_func(request, _args, *_kwargs)
    
    File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  4.     response = view_func(request, _args, *_kwargs)
    
    File "/usr/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  5.         return view(request, _args, *_kwargs)
    
    File "/usr/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  6.         return bound_func(_args, *_kwargs)
    
    File "/usr/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  7.                 response = view_func(request, _args, *_kwargs)
    
    File "/usr/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  8.             return func.**get**(self, type(self))(_args2, *_kwargs2)
    
    File "/usr/lib/python2.7/site-packages/django/contrib/admin/options.py" in changelist_view
  9.             response = self.response_action(request, queryset=cl.get_queryset(request))
    
    File "/usr/lib/python2.7/site-packages/django/contrib/admin/options.py" in response_action
  10.         response = func(self, request, queryset)
    
    File "/usr/lib/python2.7/site-packages/admin_exporter/actions.py" in export_as_csv_action
  11. return export(queryset, format="csv")
    File "/usr/lib/python2.7/site-packages/admin_exporter/actions.py" in export
  12. response = HttpResponse(data, mimetype="application/x-download")
    File "/usr/lib/python2.7/site-packages/django/http/response.py" in init
  13.     super(HttpResponse, self).**init**(_args, *_kwargs)
    

Exception Type: TypeError at /admin/lk/zoho/
Exception Value: init() got an unexpected keyword argument 'mimetype'

@Thuruv
Copy link

Thuruv commented Aug 26, 2015

because it's now called content_type.. not mimetype and HttpResponse should be called like

response = HttpResponse(data, mimetype="application/x-download")  

into

response = HttpResponse(data, content_type="application/x-download") 

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

2 participants