django-querycount
django-querycount copied to clipboard
To avoid error when lunching runserver (QUERY_STRING)
To avoid getting an error when launching the runserver if QUERY_STRING has not yet been set.
2024-05-29 09:20:41,724 django.request - ERROR Internal Server Error: /
Traceback (most recent call last):
File ".../lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File ".../lib/python3.12/site-packages/django/utils/deprecation.py", line 133, in __call__
response = self.process_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../lib/python3.12/site-packages/querycount/middleware.py", line 109, in process_request
self.query_string = request.META['QUERY_STRING']
~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'QUERY_STRING'