没有办法使命令更少冗长选项。然而,您可以将输出管道输出到您不需要关心的地方。在Linux / OS X / * nix上,您可以将输出管道输出到/ dev / null,如下所示:
$ ./manage .py runserver> / dev / nullWindows上的等效项将是:
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/nullThe equivalent on windows would be something like:
python manage.py runserver > NULOne 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详细程度
发布评论