On 12/12/2013 06:19 PM, Jonathan Baker wrote:
> Django is just Python, after all, so you can use the same approach that
> you would in "regular python scripts". "when a view is rendered" is a
> pretty vague description of what you're aiming to profile. If your start
> point is the request coming in to Django, and your stop point is the
> rendered response exiting Django, then I'd write a piece of custom
> middleware. If, on the other hand, you're aiming to profile a specific
> method of a view (like rendering a template), then you'll want to target
> the method itself. You could do this with a decorator if you're using
> FBVs, or a abstract base class if you're using CBVs. This approach is
> nice because you're abstracting away the profiling code which allows you
> to easily reuse it.
>
> Hope this helps a little,
> JDB
>
I appreciate your response, instead of using a lot of third-party apps
I have written everything on my site from scratch to get things
exactly the way I want them. I was actually hoping for a third-party
solution for this one, but if it takes me writing my own middleware
then thats just what I'll do. It is the whole request and response I
am trying to look at, but finer grain control would be good too.
Thanks again, I'm going to study up on middleware.