offical website note:
# import the logging library import logging # Get an instance of a logger logger = logging.getLogger(__name__) def my_view(request, arg1, arg): ... if bad_mojo: # Log an error message logger.error('Something went wrong!')
but it not display log info in terminal. i donit why. but i hear that use 'print' is simple.
def my_view(request, arg1, arg): ... if bad_mojo: # Log error message print 'Something went wrong!'
through my test, it works well.