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/;
        }
    }
  • 相关阅读:
    OpenGL模板 Mac Cmake OpenGL(Glut) Template
    CodeForces 277A Learning Languages (并检查集合)
    Linux netstat订购具体解释
    POJ 1936 All in All
    他的第一个NDK的Demo
    [ACM] POJ 2418 Hardwood Species (Trie树或map)
    Swift
    Swift
    Swift
    Swift
  • 原文地址:https://www.cnblogs.com/saonian/p/9685231.html
Copyright © 2011-2022 走看看