use django dev server: python manage.py runserver 8000 OK!
use uwsgi setup django: uwsgi http :8000 module wsgi OK!
it seems ok, the important parts coming!
uwsgi configurecreate uwsgi.ini file in django project directorythe file’s content is :
[uwsgi] chdir=/home/erya/hawk module=wsgi master=True processes=10 pidfile=/home/erya/hawk.pid vacuum=True max-requests=5000 enable-threads=True socket=127.0.0.1:9001 nginx configurecheck uwsgi_params file in nginx conf or you can donwload it from github https://github.com/nginx/nginx/blob/master/conf/uwsgi_params
and put it in nginx conf directory.
add uwsgi.conf file,the content is :
server { listen 8000; server_name 127.0.0.1; # client_max_body_size 64M; location / { # client_max_body_size 4M; uwsgi_pass 127.0.0.1:9001; include uwsgi_params; access_log off; } }
add one line to nginx.conf ,like
http { include mime.types; default_type application/octet-stream; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; include uwsgi.conf; ####here ... server { ....
start up(the use have the permission)uwsgi: in project directory
uwsgi --ini uwsgi.ini
nginx:
/usr/local/nginx/sbin/nginx
TestThe you can open your favorite browser, type http://127.0.0.1:8000 , you will see your project’s index page.
Of course, what i do is very simple, you can config custom configure of your project.
REFdjango_and_nginx