code: def process_request(self, request):
          def unpickle(params):
              stats = unpickle_stats(b64decode(params.get('stats', '')))
              queries = cPickle.loads(b64decode(params.get('queries', '')))
              return stats, queries
          if request.method != 'GET' and \
             not (request.META.get(
                 'HTTP_CONTENT_TYPE', request.META.get('CONTENT_TYPE', '')
             ) in ['multipart/form-data', 'application/x-www-form-urlencoded']):
              return
          if (request.REQUEST.get('profile', False) and
              (settings.DEBUG == True or request.user.is_staff)):
              request.statsfile = tempfile.NamedTemporaryFile()
              params = request.REQUEST
              if (params.get('show_stats', False)
                  and params.get('show_queries', '1') == '1'):
                  stats, queries = unpickle(params)
                  return display_stats(request, stats, queries)
              elif (params.get('show_queries', False)
                    and params.get('show_stats', '1') == '1'):
                  stats, queries = unpickle(params)
                  return display_queries(request, stats, queries)
              else:
                  request.profiler = hotshot.Profile(request.statsfile.name)
                  reset_queries()