Open simone-chiorazzo opened 7 years ago
@simone-chiorazzo This could solved be changing the call from response.rendered_content
to response.getvalue()
. This covers any concrete Response class inheriting from django.http.HttpResponse
. I would ideally like to have unit tests for this though.
I also encountered the same problem, when i changed response.rendered_content
to response.getvalue()
, the mistakes still exist, so i set response
field to be ''
, i hope this will help you.
Hi,
drf-tracking 1.2.0 crash if you use a DRF APIView that returns a FileResponse. Could you fix this behaviour?
Thanks, Simone
Crash report
Environment: development
Request Method: GET Request URL: http://prm.mydevelopmentenv.com/api/export/files
Django Version: 1.8.18 Python Version: 3.3.5 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'debug_toolbar', 'django_q', 'rest_framework', 'rest_framework.authtoken', 'rest_framework_tracking', 'maintenancemode', 'prm') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'prm.middleware.SetRemoteAddrMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'maintenancemode.middleware.MaintenanceModeMiddleware')
Traceback: File "/home/prm/virtualenv/lib/python3.3/site-packages/django/core/handlers/base.py" in get_response
Exception Type: AttributeError at /api/export/files Exception Value: 'FileResponse' object has no attribute 'rendered_content'