I have some debugging statements that I need to print out from my Django out, but I cannot find which file to look for them. They do not appear in the access logs or the error logs. Where can I find the file which they appear?
I have some debugging statements that I need to print out from my Django out, but I cannot find which file to look for them. They do not appear in the access logs or the error logs. Where can I find the file which they appear?
2
Answers
They appear in your console where you run : python manage.py runserver
Of course you need to trigger the functions where there are prints so they execute it.
For anyone else who comes here later: I had to, on my local laptop, add this to my settings.py to get print statements to appear on my console:
https://docs.djangoproject.com/en/2.1/topics/logging/#examples
The second example shows how to print to console:
I don’t recall having to do this in years/django versions past, so either this used to be in the settings by default, or more likely it’s something that got changed so now you have to specify this in settings.