from django.shortcuts import render
import logging

logging_format = '%(asctime)s - %(levelname)s - %(filename)s:%(lineno)d - %(message)s'
logging.basicConfig(level=logging.DEBUG, format=logging_format)

def some_view(request):
    logging.debug('This is a debugging message')
    return render(request, 'some_template.html', {})