Does querystats
support DRF endpoints?
#68
-
I'm integrating with
I suspect (but am not positive) that this is because DRF-flavored responses don't support |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 2 replies
-
At least in my basic test, this error shows up when you're looking at the browsable API (which makes sense because it would be a template response)? Interesting that they must be setting As a first step I went ahead and added another condition to skip the rendering logic if As far as perf goes, this stuff only runs if |
Beta Was this translation helpful? Give feedback.
At least in my basic test, this error shows up when you're looking at the browsable API (which makes sense because it would be a template response)? Interesting that they must be setting
response.context_data = None
. Seems to work fine for me on regular API calls and you can see the querystats in theServer-Timing
header:As a first step I went ahead and added another condition to skip the rendering logic if
context_data is None
, so the error should be fixed (which also means you won't be able to view the querystats UI on the DRF browsable API right now). You can try forge-querystats v0.2.1 now.As far as perf goes, this stuff only runs if
settings.DEBUG
(local dev) or if you're logged i…