print('Started db query')
result = SomeComplexModel.objects.all()
print('Finished db query, took ', time.time() - start)
return render('some_complex_template.html', {'result': result})
How to profile django application with respect to execution time?