Django manage.py runserver verbosity

前端 未结 3 1697
遇见更好的自我
遇见更好的自我 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:58

    I managed to pull it off by disabling logging in general, as I am launching my application as a subprocess of different application. Documentation.

    This blocks all logs including Watching for file changes with StatReloader.

    And all logs of this kind: [31/Jul/2020 20:42:17] "GET /admin/ HTTP/1.1" 200 6641.

    By adding this to my settings.py:

    LOGGING = {
        "version": 1,
        "disable_existing_loggers": True,
    }
    

提交回复
热议问题