From de7cd0d7c769399f29859d28dc29c33c15253641 Mon Sep 17 00:00:00 2001 From: Clement Cavanier Date: Wed, 29 May 2024 11:34:11 +0200 Subject: [PATCH] To avoid getting an error when launching the runserver if QUERY_STRING has not yet been set. --- querycount/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/querycount/middleware.py b/querycount/middleware.py index 3b2765f..6f74e9d 100644 --- a/querycount/middleware.py +++ b/querycount/middleware.py @@ -106,7 +106,7 @@ def process_request(self, request): if settings.DEBUG and not self._ignore_request(request.path): self.host = request.META.get('HTTP_HOST', None) self.request_path = request.path - self.query_string = request.META['QUERY_STRING'] + self.query_string = request.META.get('QUERY_STRING', None) self._start_time = timeit.default_timer() self._count_queries("request")