在 Django 中,如何允许打印语句与 Apache WSGI 一起使用? [英] In Django, how do I allow print statements to work with Apache WSGI?

查看:16
本文介绍了在 Django 中,如何允许打印语句与 Apache WSGI 一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

"print" 仅适用于开发服务器.但是如果我想让它在 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.

(只打印到空)

推荐答案

至于quick print,就可以用:

print >>sys.stderr, 'log msg'

--当然,它会出现在 error.log 中.

-- then it lands in error.log, of course.

这篇关于在 Django 中,如何允许打印语句与 Apache WSGI 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆