Django manage.py runserver详细程度 [英] Django manage.py runserver verbosity

查看:135
本文介绍了Django manage.py runserver详细程度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使runserver命令完全安静或只显示错误404或500?
verbosity选项对它没有影响...

解决方案

没有办法使命令更少冗长选项。然而,您可以将输出管道输出到您不需要关心的地方。在Linux / OS X / * nix上,您可以将输出管道输出到/ dev / null,如下所示:

  $ ./manage .py runserver> / dev / null 

Windows上的等效项将是:

  python manage.py runserver> NUL 

最后一个注意事项:如果您在开发中试图抑制输出作为偏好的问题环境很棒!这应该适合你。如果您正在寻找几乎任何其他原因,这可能是一个迹象表明,您正在使用的dev服务器,你不应该的东西。除了本地开发之外,./manage.py runserver不应该用于 任何


Is there a way to make the runserver command completely quiet or just display errors like 404 or 500 ?? verbosity option has no effect on it...

解决方案

There is no way to make the command less verbose with options. You can however pipe the output someplace where you don't need to care about it. On Linux/OS X/*nix you can pipe the output to /dev/null with something like:

$ ./manage.py runserver > /dev/null

The equivalent on windows would be something like:

python manage.py runserver > NUL

One last note: If you are seeking to suppress the output as a matter of preference in your development environment, awesome! This should work for you. If you are seeking to do this for almost any other reason, it's probably a sign that you are using the dev server for something which you shouldn't. "./manage.py runserver" should never be used for anything other than local development.

这篇关于Django manage.py runserver详细程度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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