使用Nginx部署Django
参考文章链接 我的环境 conda 4.7.10、python 3.6.7、Django 3.0.3 安装uWSGI pip install uwsgi 这里如果出现了问题,可以考虑如下解决办法: 参考链接 apt-get install python3-dev apt-get install gcc-4.7 ##卸载你的gcc版本,安装为4.7: rm /usr/bin/gcc ln -s /usr/bin/gcc-4.7 /usr/bin/gcc 最后重新运行安装命令 pip install uwsgi 测试uWSGI是否正常工作 新建一个test.py文件: touch test.py 若之后要删除则运行 rm 文件名 输入如下内容: def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return [b"Hello World"] # python3 #return ["Hello World"] # python2 运行uWSGI: uwsgi --http :8080 --wsgi-file test.py 可能会报错: uwsgi: error while loading shared libraries: libpcre.so.1