Printing to stdout breaks webapp when running behind modwsgi

Issue #228 new
Anonymous created an issue

Hello,

We're running a web service using modwsgi, and this service used django-piston to provide its REST APIs.

Some of our resources are protected using OAuthAuthentication, and the current source code has a print statement inside the is_authenticated method:

https://bitbucket.org/jespern/django-piston/src/7c90898072ce9462a6023bbec5d408ad097a362b/piston/authentication.py?at=default#cl-258

When the services is run and tests locally, everything works fine. When run in the production environment, which uses modwsgi, we get 500 when accesing the API since modwsgi fails due to the attempt to write to sys.stdout.

Is there any chance to make this piston code not to write to stdout? Ideally a logging setup should be used instead, specially if this is for debugging purpouses.

Thanks.

Comments (0)

  1. Log in to comment