zoukankan      html  css  js  c++  java
  • Nginx+uswgi+Django部署

    myweb_uwsgi.ini配置文件

    # myweb_uwsgi.ini file
    [uwsgi]
     
    # Django-related settings
     
    socket = :8000
     
    # the base directory (full path)
    chdir = /home/jasonhaven/workspace/HomeMe
     
    # Django s wsgi file
    module = HomeMe.wsgi
     
    # process-related settings
    # master
    master = true
     
    # maximum number of worker processes
    processes = 4
     
    # ... with appropriate permissions - may be needed
    # chmod-socket    = 664
    # clear environment on exit
    vacuum = true

    运行:

    uwsgi --ini myweb_uwsgi.ini#通过uwsgi命令读取myweb_uwsgi.ini文件启动项目

    链接uwsgi、nginx、django

    server {
        listen         80; 
        server_name    127.0.0.1 
        charset UTF-8;
        access_log      /var/log/nginx/dj_access.log;
        error_log       /var/log/nginx/dj_error.log;
     
        client_max_body_size 15M;
     
        location / { 
            include uwsgi_params;
            uwsgi_pass 127.0.0.1:8000;
            uwsgi_read_timeout 2;
        }   
        location /static {
            expires 30d;
            autoindex on; 
            add_header Cache-Control private;
            alias /home/pyCode/py3.7/testdj/static/;
        }
    }
  • 相关阅读:
    HDU 1058 Humble Numbers
    HDU 1421 搬寝室
    HDU 1176 免费馅饼
    七种排序算法的实现和总结
    算法纲要
    UVa401 回文词
    UVa 10361 Automatic Poetry
    UVa 537 Artificial Intelligence?
    UVa 409 Excuses, Excuses!
    UVa 10878 Decode the tape
  • 原文地址:https://www.cnblogs.com/saonian/p/9685231.html
Copyright © 2011-2022 走看看