2024/10/10 21:25:44 PM - ERROR - Internal Server Error: /abc Traceback (most recent call last): File "/root/abc/backend/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/root/abc/backend/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/root/abc/backend/guolei-django20240831/./DTUmanage/views.py", line 346, in Configue_DTU_UpdateTime_RoundRobin client = connect_mqtt() File "/root/abc/backend/guolei-django20240831/./DTUmanage/views.py", line 199, in connect_mqtt client = mqtt_client.Client(client_id) File "/root/abc/backend/venv/lib/python3.8/site-packages/paho/mqtt/client.py", line 772, in __init__ raise ValueError( ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details [pid: 23219|app: 0|req: 7/13] 221.11.20.106 () {40 vars in 846 bytes} [Thu Oct 10 21:25:44 2024] GET /Configue_---_RoundRobin?update_per_secon ds=30&uploadtime_per_seconds=30&imei_string=86165806873&dtuID=3 => generated 145 bytes in 128 msecs (HTTP/1.1 500) 8 headers in 283 bytes (1 switches on core 0)
解决方法:
卸载 paho-mqtt 2.1.0
重新安装 paho-mqtt 1.6.1:
paho-mqtt==1.6.1标签:abc,version,py,callback,mqtt,API,backend From: https://www.cnblogs.com/emanlee/p/18457189