How do I fix error "TypeError at / ‘dict’ object is not callable" located in exception.py?

Adding django CMS to an existing Django project, I'm getting the error: "TypeError at / ‘dict’ object is not callable".

This is the output:

TypeError at /
'dict' object is not callable
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Django Version: 4.2.13
Exception Type: TypeError
Exception Value:    
'dict' object is not callable
Exception Location: C:\Users\USER\.virtualenvs\AnalyticsScout_V_1_1-2IRLUV3q\lib\site-packages\django\core\handlers\exception.py, line 55, in inner
Python Executable:  C:\Users\USER\.virtualenvs\AnalyticsScout_V_1_1-2IRLUV3q\Scripts\python.exe
Python Version: 3.9.16
Python Path:    
['C:\\Users\\USER\\OneDrive\\Bureau\\AnalyticsScout_V_1_1',
 'C:\\Users\\USER\\miniconda3\\python39.zip',
 'C:\\Users\\USER\\miniconda3\\DLLs',
 'C:\\Users\\USER\\miniconda3\\lib',
 'C:\\Users\\USER\\miniconda3',
 'C:\\Users\\USER\\.virtualenvs\\AnalyticsScout_V_1_1-2IRLUV3q',
 'C:\\Users\\USER\\.virtualenvs\\AnalyticsScout_V_1_1-2IRLUV3q\\lib\\site-packages']
Server time:    Fri, 21 Jun 2024 09:26:19 +0000

In my local project I have the ‘exception.py’ file as the one in: Exception.py

Whenever I run Django, I’m getting the following output in the terminal :

Microsoft Windows [Version 10.0.22000.2538]
(c) Microsoft Corporation. All rights reserved.

(AnalyticsScout_V_1_1-2IRLUV3q) (base) C:\Users\USER\OneDrive\Bureau\AnalyticsScout_V_1_1>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
June 21, 2024 - 05:26:05
Django version 4.2.13, using settings 'analyticsscout.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

Internal Server Error: /
Traceback (most recent call last):
  File "C:\Users\USER\.virtualenvs\AnalyticsScout_V_1_1-2IRLUV3q\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
TypeError: 'dict' object is not callable
[21/Jun/2024 05:26:20] "GET / HTTP/1.1" 500 74922
[21/Jun/2024 05:26:20] "GET /static/debug_toolbar/css/toolbar.css HTTP/1.1" 304 0
[21/Jun/2024 05:26:20] "GET /static/debug_toolbar/js/toolbar.js HTTP/1.1" 304 0
[21/Jun/2024 05:26:20] "GET /static/debug_toolbar/css/print.css HTTP/1.1" 304 0
[21/Jun/2024 05:26:20] "GET /static/debug_toolbar/js/utils.js HTTP/1.1" 304 0
Internal Server Error: /favicon.ico
Traceback (most recent call last):
  File "C:\Users\USER\.virtualenvs\AnalyticsScout_V_1_1-2IRLUV3q\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
TypeError: 'dict' object is not callable
[21/Jun/2024 05:26:21] "GET /favicon.ico HTTP/1.1" 500 74822

My attempts:

Before running Django server,

  • I activated my virtualenv using ‘pipenv shell’
  • In the line 15, I replaced get_response by _get_response but, not successful.
  • Also, in the line 15, I replaced get_response() by get_response[ ] but, not successful.

Any help to fix this issue will be appreciated. Thank you.

Back to Top