python bottle framework - run in silent (non-verbose) mode - how?
Question
I am learning to use the python bottle web framework. I have developed a simple app and I would like to suppress all the requests (urls) output on the terminal (though if there are any error msgs, their output should be ok). I tried setting the DEBUG to False, but that did not make any difference. Is there some other setting for this?
La solution
This works for some servers (including wsgiref):
bottle.run(..., quiet=True)
Autres conseils
As mentionned by Helgi, the bottle dev server should'nt be used in production. With most of production server, you will not have these logs.
However, if you want to have a quiet dev server, something like this should work.
import bottle
class QuietWSGIRefServer(bottle.WSGIRefServer):
quiet = True
bottle.run(BOTTLE_APP, server=QuietWSGIRefServer)
I hope it helps
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow