Is there a way to print messages to Django development console?
I’m running 1.1 Django in buildout environment.
So running bin/django runserver (manage.py runserver) it shows development console where it writes resources, actions taken (equivalent of apache access/error logs(?)).
I want to print custom messages to that console for debugging purposes that it wouldn’t kill the action just notice me.
Should i use logging module or is there other way?
If you’re sure you just want it in development, you can simply use
print– the message appears in the console.However, you will need to delete the print statement before you deploy to production, as this will cause an error with Apache.
A better long-term solution is to use the
loggingmodule, configured to output to the console.