0

I want to monitor my views in Django aplication at production environment.So, I came across the solution script I tested in my local environment.works fine!!.

When I went live with the production environment, I was facing issue with Unhandled Exception due to debug=True.I used debug=True(serve the static by django server) in local environment also.

Is it possible to use the above link middleware for accessing the hotshot of the corresponding django view?

Could you please help me out to do hotshot or cProfile which is referred in the link for django production server?

Nava
  • 6,276
  • 6
  • 44
  • 68

1 Answers1

0

The middleware you posted should work fine in production — NB the instruction in the comment at the top:

It is active if you are logged in as a superuser, or always when settings.DEBUG is True.

So just make sure you're logging in as a superuser.

That said, I've personally never had much luck with these cProfile middleware solutions. It's pretty easy to run cProfile yourself (using cprofile.run()), and you can view the output using KCacheGrind

Community
  • 1
  • 1
supervacuo
  • 9,072
  • 2
  • 44
  • 61