django-querycount icon indicating copy to clipboard operation
django-querycount copied to clipboard

To avoid error when lunching runserver (QUERY_STRING)

Open cavanierc opened this issue 9 months ago • 0 comments

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'

cavanierc avatar May 29 '24 09:05 cavanierc