开发者

How to print Django's runserver output to a file?

开发者 https://www.devze.com 2023-01-21 13:17 出处:网络
when i develop my django app locally, i use python manage.py runserver and all errors messages (like Error 500 ...) are printed in the terminal.

when i develop my django app locally, i use python manage.py runserver and all errors messages (like Error 500 ...) are printed in the terminal. It is useful because it enables to put s开发者_C百科ome printin the code and check the values of some variables.

But when the app is executed via fastgci on a remote server i can't see those messages. Is there a way to output those errors in a file? Thanks


Barring bugs in the web server, error messages generated by FastCGI apps should be logged in the web server's error log. Use your web server configuration options to control where the log is created.

And don't use print, use logging instead.

0

精彩评论

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