django – What is the use of PYTHONUNBUFFERED in docker file?

django – What is the use of PYTHONUNBUFFERED in docker file?

Setting PYTHONUNBUFFERED to a non empty value ensures that the python output is sent straight to terminal (e.g. your container log) without being first buffered and that you can see the output of your application (e.g. django logs) in real time.

This also ensures that no partial output is held in a buffer somewhere and never written in case the python application crashes.

References:

PYTHONUNBUFFERED non empty value force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream

django – What is the use of PYTHONUNBUFFERED in docker file?

Leave a Reply

Your email address will not be published. Required fields are marked *