在Django中,如何允许print语句与Apache WSGI配合使用? [英] In Django, how do I allow print statements to work with Apache WSGI?
本文介绍了在Django中,如何允许print语句与Apache WSGI配合使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
打印仅适用于开发服务器。
但是如果我想让它在Apache中工作呢?为了防万一我忘了评论,我希望能够顺利进行,而不会导致错误。
"print" only works in development server. But what if I want it to work in Apache? Just in case I forget to comment it out...I want to be able to go smoothly without causing errors.
(只打印无)
推荐答案
至于快速打印
,只需使用:
print >>sys.stderr, 'log msg'
- 然后它进入error.log当然。
-- then it lands in error.log, of course.
这篇关于在Django中,如何允许print语句与Apache WSGI配合使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文