一 .centos的相關依賴安裝html
二.數據庫服務的安裝python
三.python虛擬環境mysql
四.安裝及測試nginx
def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return [b"Hello World"]
[uwsgi] socket = 服務器IP:8001 #注如在同一服務器上能夠使用127.0.0.1 chdir = /home/foobar/myproject/ wsgi-file = myproject/wsgi.py master = true processes = 4 threads = 2
upstream django { server IP:8001; #對應uwsgi.ini中socket,也可一寫爲127.0.0.1 } # configuration of the server server { listen 8000; #對應瀏覽器 server_name IP; charset utf-8; access_log /var/log/nginx/blog_access.log; client_max_body_size 8M; # adjust to taste location /media { #配置上傳文件 alias /usr/local/site/demo/project-blog/media; } location /static { #配置靜態文件 alias /usr/local/site/demo/project-blog/static; } location / { uwsgi_pass django; #對應upstream django include /etc/nginx/uwsgi_params; } }