美文网首页django
django+uwsgi+nginx部署

django+uwsgi+nginx部署

作者: amyhy | 来源:发表于2017-09-14 19:56 被阅读14次

    在项目的文件夹下新建文件blog.ini文件

    [uwsgi]
    socket=:8089
    chdir = /home/student/project/newsite/
    wsgi-file = /home/student/project/newsite/newsite/wsgi.py
    processes = 4
    threads = 2
    stats = 127.0.0.1:9191 
    

    启动uwsgi ———>uwsgi --ini blog.ini

    在/etc/nginx/conf.d 文件夹中建立一个以.conf结尾的文件 blog.conf

    server {
        listen  8092;
        server_name localhost;
        charset UTF-8;
        access_log  /home/student/project/newsite_access.log;
        error_log   /home/student/project/newsite_error.log;
    
        client_max_body_size 75M;
    
        location / {
            include uwsgi_params;
            uwsgi_pass localhost:8089;
            uwsgi_read_timeout 2;
        }
    }
    

    相关文章

      网友评论

        本文标题:django+uwsgi+nginx部署

        本文链接:https://www.haomeiwen.com/subject/eefjsxtx.html