Open anniethiessen opened 6 years ago
@anniethiessen I discovered a work-around, might not be useful for you after 2 years but just putting it here so that someone from the future can use it.
Instead of
Tracker.objects.create_from_request(self.request, obj)
use
Tracker.objects.create_from_request(self.request._request, obj)
This will give you the underlying WSGIRequest object which works perfectly.
@anniethiessen I discovered a work-around, might not be useful for you after 2 years but just putting it here so that someone from the future can use it. Instead of
Tracker.objects.create_from_request(self.request, obj)
use
Tracker.objects.create_from_request(self.request._request, obj)
This will give you the underlying WSGIRequest object which works perfectly.
The workaround doesn't help. It faces another error:
'WSGIRequest' object has no attribute 'user_agent'
DRF views don't inherit from HttpRequest class. Is there a work around?