部署python3.6下的django

首先是安装好nginx,配置web目录,配置文件在confi.d中,

server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name localhost; # substitute your machine's IP address or FQDN
    charset     utf-8;

    # max upload size
    client_max_body_size 75M;   # adjust to taste

    # Django media
    location /media  {
        alias /var/www/myweb/media;  # your Django project's media files - amend as required
    }

    location /static {
        alias /var/www/myweb/static; # your Django project's static files - amend as required
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        include    /etc/nginx/uwsgi_params; # the uwsgi_params file you installed
        uwsgi_pass 127.0.0.1:8001;
    }
}

修改nginx配置文件后,需要重新启动nginx

service nginx restart

把web文件git上传到/var/www/myweb中去

猜你喜欢

转载自www.cnblogs.com/andu99/p/9145562.html