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 Answers
You can now set the verbosity with the verbosity
flag:
./manage.py runserver --verbosity 0
-
5However, runserver (1.7) doesn't seem to comply with the verbosity 0 argument. I'm getting the exact same output.– JuanXargMar 19, 2015 at 14:57
-
1@JuanXarg it should : docs.djangoproject.com/en/1.7/ref/django-admin/…– ErowlinMar 19, 2015 at 15:33
-
1Django runserver ignores verbosity or traceback option. See this discussion over this ticket code.djangoproject.com/ticket/15132 Apr 18, 2017 at 16:05
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.
-
2+1 for "runserver should never be used for anything other than local development"– sidhsharJan 21, 2011 at 5:16
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,
}