参考:https://www.cnblogs.com/chenice/p/6921727.html 参考:https://blog.csdn.net/fengzq15/article/details/78633827 ubuntu上安装apache2:https://blog.csdn.net/StepTimeNatural/article/details/78153740 ubuntu上部署django使用AWS:https://blog.csdn.net/biboshouyu/article…
最近使用django写了一些项目,不过部署到服务器上碰到一些问题,还有静态文件什么的一堆问题,这里总结一下碰到的问题和解决方案,总体思路是按照官方文档走的. 原文地址:http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html 讲的很清楚,不过还是需要一些注意的地方 对于uwsgi+nginx的部署方式,它的访问关系大概是: the web client <-> the web server <-&…
更新系统软件源 sudo apt-get update pip3安装 sudo apt install python3-pip 安装virtualenvwrapper pip3 install virtualenvwrapper 修改.bashrc,最后面添加以下代码: export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 source /usr/local/bin/virtualenvwrapper.sh 重新加载配置 source ~/.bashr…
部署条件: 1.一台阿里云服务器(本人的是CentOS系统的服务器) 2.已经构建好的项目 3.服务器上安装并配置Nginx 首先第一步:在服务器上安装并配置Nginx 进入服务器 $ ssh root@服务器IP     安装编译工具以及库文件: yum -y install make gcc-c++ libtool          安装PCRE(PCRE 作用是让 Nginx 支持 Rewrite 功能) $ cd /usr/local $ wget http://downloads.so…
1. 概念解析(wsgi协议,uwsgi协议,uWSGI) 参考:https://www.cnblogs.com/wspblog/p/8575101.html 1.1 现实世界的web请求: 1.2  wsgi协议,uwsgi协议和uWSGI a. WSGI(wsgi): 全称 Web Server Gateway Interface,或者 Python Web Server Gateway Interface ,是为 Python 语言定义的 Web 服务器和 Web 应用程序或框架之间的一种…
安装uWSGI,pip依据自己要使用的python版本自行选择,python2.x版本使用pip进行安装,python3.x版本使用pip3进行安装 pip install uwsgi 配置uWSGI,在项目中新建文件uwsgi.ini,即在含有manage.py文件的文件夹下新建uwsgi.ini文件,编写如下配置 [uwsgi] socket=外网ip:端口(使用nginx连接时,使用socket) http=外网ip:端口(直接做web服务器,使用http) chdir=项目根目录 wsg…
conda 环境不必多说: conda(或source)  activate  test 进入test虚拟环境 接下来安装uwsgi: pip install uwsgi 在conda环境下大概率安装不成功,可以使用一下命令代替: conda install -c conda-forge uwsgi 运行uwsgi 有可能碰到 libiconv.so 动态库找不到的问题,同样可以用conda安装 conda install -c conda-forge libiconv uwsgi安装好后,需要…
一.nginx介绍及部署 二.nginx部署路飞学城代码 nginx配置安装 同样,nginx也有很多的安装方式: 1)源码安装(运维偏向:规范,便于配置管理) 2)yum,rpm安装(为了效率可以选用) nginx官网:http://nginx.org/…
首先进入conda 虚拟环境: source activate test 安装gunicorn: pip install gunicorn 运行gunicorn gunicorn -w 2 -b 127.0.0.1:9200 -D test.wsgi:application   # -D 为后台运行 或者配置gunicorn.py  文件,并放置在项目根目录下: from gevent import monkey monkey.patch_all() import multiprocessing…
引言 在本文中将介绍在Docker中通过django + uwsgi + nginx部署方式部署Django项目, 由于记录的是学习过程,使用的都是目前较高的版本. python 版本为3.8.3 django 版本为3.0.6 nginx 版本为1.17.10 好了简单的介绍之后,就进入正题了. 创建一个工作目录 创建一个工作目录用来存放项目,和Dockerfile等文件. mkdir uwsgidocker 简单说明一下各个文件 docker-compose.yml: Docker Comp…