django + gninx + gunicorn 应用程序缺少 "dnspython" 错误,即使将其安装到正确的虚拟环境后也是如此

Missing "dnspython" error for django + gninx + gunicorn app, even after installing it to the correct virtual environment

出现以下错误:

The "dnspython" module must be installed to use mongodb+srv:// URIs

异常位置:

../python3.7/site-packages/pymongo/uri_parser.py, line 428, in parse_uri

尝试将 pymongo 与 django 应用程序一起使用时。我尝试使用 pip3 将 dnspython 安装到正确的虚拟环境,但仍然出现错误。

我也试过重启gninx。

解决问题的方法很简单,就是重新启动gunicorn服务文件