Django manage.py runserver详细程度

编程入门 行业动态 更新时间:2024-10-26 06:31:01
本文介绍了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详细程度

本文发布于:2023-10-22 22:20:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1518896.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程度   详细   manage   Django   runserver

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!