Задать вопрос

Тел: +7 965 3737 888

485

Просмотров

4

Ответов

SQL Printing Middleware

Just put it in your python path and add it into MIDDLEWARE_CLASSES.

I know that there are a couple of snippets on this site that do something similar to this, but none of them quite suited me.

I wanted something that would indent and space the SQL so that I could differentiate it from the other output from the development server.

Also, I wanted something that would output total query execution time, which my solution does. I just hope that it's useful for someone else, too!

UPDATE: Now this should no longer get upset when running it on windows.

Вопрос полезен? Да0/Нет0
file_3650.py(1.7Кб)
None

Ответы (4):

Ответvman:02.06.2009
Ответ полезен? Да0/Нет0

What is the exact line that goes into MIDDLEWARE_CLASSES?

Ответclohfink:28.04.2009
Ответ полезен? Да0/Нет0

Exactly what I was looking for, thank you.

Ответzir.echo:05.02.2009
Ответ полезен? Да0/Нет0

This is great, thank you!

Ответmiguel:18.06.2007
Ответ полезен? Да0/Нет0

Very nice, I'm using it in my development environment.