Django manage.py runserver verbosity

前端 未结 3 1773
遇见更好的自我
遇见更好的自我 2021-02-20 18:15

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...

3条回答
  •  别那么骄傲
    2021-02-20 18:52

    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.

提交回复
热议问题