dcramer / django-devserver

A drop-in replacement for Django's runserver.
BSD 3-Clause "New" or "Revised" License
1.27k stars 159 forks source link

Support profiling Django 1.3+ CBVs #74

Closed acdha closed 11 years ago

acdha commented 11 years ago

This allows you to profile methods on CBVs. Since everything is hanging off of the request object it's still non-trivial to profile other methods (e.g. get_context_data) but it's at least possible to do this::

class MyView(TemplateView):
   …

    @devserver_profile(follow=[do_heavy_lifting])
   def get(self, request):
       …