Extended Profiling Middleware
Modified version of Profiling Middleware
Prints profile results for method, additionally groups results by files and by modules (for django uses top level modules as groups). Works for Windows.
Usage: append ?prof or &prof= to any URL pointing to django application after adding ProfileMiddleware to middlewares in yours settings.py.
NOTICE: ProfileMiddleware uses hotshot profiler which is not thread safe.
You can replace the tiercary operator mentionned above with
res += "%4.1f%% %7.3f %s\n" % ( sum and 100*item/sum or 0, item, item )
So it run on python 2.4
And to have a (little) more info on SQL request, you could extend the code of andrew with this :
response.content += '\n%d SQL Queries in %.3f seconds :\n' %(
len(connection.queries), sum([ float(i.get('time', 0)) for i in connection.queries ]))
response.content += pprint.pformat(connection.queries)
in the process_response file.