Как исправить ошибку "TypeError at / 'dict' object is not callable", расположенную в exception.py?

Добавление django CMS в существующий проект Django, Я получаю ошибку: "TypeError at / 'dict' object is not callable".

Вот вывод:

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

В моем локальном проекте есть файл 'exception.py', как в: Exception.py

Всякий раз, когда я запускаю Django, я получаю следующий вывод в терминале :

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

Мои попытки:

Перед запуском сервера Django,

  • Я активировал свой virtualenv с помощью 'pipenv shell'
  • .
  • В строке 15 я заменил get_response на _get_response, но безрезультатно.
  • Также в строке 15 я заменил get_response() на get_response[ ], но не успешно.

Любая помощь в решении этой проблемы будет оценена по достоинству. Спасибо.

Вернуться на верх