码迷,mamicode.com
首页 > 其他好文 > 详细

Django runserver show client ip

时间:2016-01-09 17:05:57      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

get path of basehttp.py

$ python
>>> import site
>>> site.getsitepackages()
[/usr/lib64/python2.7/site-packages,
 /usr/lib/python2.7/site-packages,
 /usr/lib/site-python]

change log_message() msg = "[%s] %s\n" % (self.log_date_time_string(), format % args) to the following

msg = "[%s] (%s)" % (self.log_date_time_string(), self.client_address[0])

makes you looks like this

[09/Jan/2016 15:55:37] (127.0.0.1) "POST /m HTTP/1.0" 200 59

 

Django runserver show client ip

标签:

原文地址:http://www.cnblogs.com/exclm/p/5116623.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!