I have a Django Proj running in Docker Container
My Debug=True
but docker up logging doesn't show any print('xxxx') output.
Is there a way to fix it? thanks!
I have a Django Proj running in Docker Container
My Debug=True
but docker up logging doesn't show any print('xxxx') output.
Is there a way to fix it? thanks!
 
    
    After a long search I found this https://serverfault.com/a/940357
Add flush=True
print(datetime.now(), flush=True)
Or add PYTHONUNBUFFERED: 1 to docker-compose.yml which is added by PyCharm by default
version: '3.6'
services:
  test:
    ....
    environment:
      PYTHONUNBUFFERED: 1  # <---
    ....
