使用nginx+uwsgi配置django项目

yum install nginx sqlite-devel sqlite zlib-devel -y

cat /etc/nginx/conf.d/py.conf

server {
    listen 80;
    server_name 192.168.1.160;
    index index.html;
    client_max_body_size 100M;

    location / {
        include uwsgi_params;
        uwsgi_pass 127.0.0.1:8005;
        uwsgi_param UWSGI_SCRIPT BBS.wsgi;
        uwsgi_param UWSGI_CHDIR /code/BBS;
    }
}

解压python文件

tar -xvf Python-3.6.8.tar.xz

cd /opt/Python-3.6.8

./configure --prefix=/opt/python-3-6-8/

make && make install

配置python 环境变量

vim /etc/profile

export PYTHON_HOME=/opt/python-3-6-8
export PATH=$PYTHON_HOME/bin:$PATH

source /etc/profile








猜你喜欢

转载自blog.51cto.com/silencezone/2339026