Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Does querystats support DRF endpoints? #68

Answered by davegaeddert
jmduke asked this question in Q&A
Discussion options

You must be logged in to vote

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 the Server-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…

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@jmduke
Comment options

Answer selected by jmduke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants