Eric Floehr schrieb:
> from django.db import connection
> class Logging:
> def process_response(self, request, response):
> for query in connection.queries:
> print "[%s] %s" % (query['time'], "
> ".join(query['sql'].split()))
> return response
>
> Which results
Thanks James, that did the trick. For others that may be looking, here
is my solution:
In my settings file I added below the middleware setting:
if DEBUG:
MIDDLEWARE_CLASSES += ('web.middleware.Logging',)
and in a file called "middleware.py" in my project directory (/web):
from django.db
I have a similar solution/problem...
Firstly, my "solution" was to create a method in my vews.py like this...
def my_render(request, template, dict):
url_time = 0
try:
for query in connection.queries:
log( query['time'] + "\t" +
Thanks James, that makes sense!
I think I still have a problem though...I was trying a simple example
of a problem I am having. I wanted to create a page that would show
all the queries and their times, for performance checking. So I would
do various things on the website, which would get
4 matches
Mail list logo