开发者

Django view gets called twice... sometimes

开发者 https://www.devze.com 2023-03-19 04:26 出处:网络
I have several logging.debug statements in the home view of a web site, mainly to log the start time and the end time of a bunch of sql queries.

I have several logging.debug statements in the home view of a web site, mainly to log the start time and the end time of a bunch of sql queries.

However, sometimes, I see those sets of debug statements pop up twice in a row in the debug log. Of course, during that time only one user has made ONE request (as in refresh, hit enter, etc.)

Any ideas on what might cause this? We think th开发者_开发百科is may be related to another problem we're having.


It's possible your view function is called once, but you are logging twice. I've had problems before where my logging add_handler call was being run twice, so the log had the same handler twice, so one log.debug() call would result in the same message in the log twice.

0

精彩评论

暂无评论...
验证码 换一张
取 消