Loading... # 踩坑集锦 ## 1.404 not found 反向代理的配置 ``` location /automhy { proxy_pass http://120.25.173.79:8099; } ``` 但结果是 ![2022-11-26T14:08:28.png][1] 如果在地址最后加上/又可以了 ``` location /automhy/ { proxy_pass http://120.25.173.79:8099; } ``` ![2022-11-26T14:08:41.png][2] ## 2.已经安装django了缺提示No module named 'django' uwsgi的错误日志提示 ``` Traceback (most recent call last): File "/www/wwwroot/www.pangjuzhong.xyz/automhy/./automhy/wsgi.py", line 12, in <module> from django.core.wsgi import get_wsgi_application ModuleNotFoundError: No module named 'django' ``` 一开始没有问题,加了个开机自启后就莫名其妙出了这个错误,苦苦查询资料找到了解决方法 在uwsgi.ini中加入django的路径 ``` pythonpath = /home/ecs-assist-user/.local/lib/python3.8/site-packages ``` 我的django在这个路径下,其他人的可能不一样,所以路径要按实际来写,具体查找办法是 在终端进入python,输入 ```python import sys print(sys.path) ``` 得到结果 ```python ['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/ecs-assist-user/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/local/lib/python3.8/dist-packages/cloud_init-19.1.11-py3.8.egg', '/usr/lib/python3/dist-packages'] ``` 再按照上面的路径一个一个找就行了 [1]: https://artrajz.cn/usr/uploads/2022/11/3792065997.png [2]: https://artrajz.cn/usr/uploads/2022/11/450281249.png [3]: https://artrajz.cn/usr/uploads/2022/11/885975766.png Last modification:March 27, 2023 © Allow specification reprint Support Appreciate the author WeChat Like 0 如果觉得我的文章对你有用,请随意赞赏