It ' s quite simple-to-run Django on Windows. Here is some key steps to follow-
1. Download Nginx/windows from http://nginx.org/en/download.html
2. Unzip the Pckage (like Nginx-1.7.2.zip) to a folder in your machine)
3. Install flup (fastcgi connecting Nginx and Django) from Https://pypi.python.org/pypi/flup
4. Configure nginx config file. Some Key section is shown below,
server { Listen 8000; server_name localhost; Location~ ^/{ Fastcgi_pass 127.0.0.1:8001; #Fastcgi_index index.htmlFastcgi_param path_info $fastcgi _script_name; Fastcgi_param Request_method $request _method; Fastcgi_param query_string $query _string; Fastcgi_param Content_Type $content _type; Fastcgi_param content_length $content _length; Fastcgi_param server_protocol $server _protocol; Fastcgi_param server_port $server _port; Fastcgi_param server_name $server _name; Fastcgi_pass_header Authorization; Fastcgi_intercept_errors off; } }
Nginx would listen on 8000 ports, and when you access the Django site, it would pass the request to your Django application Listening on 8001 port.
Also Add the following section to the Conf file-to-tell nginx-to-render static files in your Django application.
^/static/ { root "c:/users/yufa/desktop/document/study/django/sqlmonitor/" ; Expires 30d; # root html; # index index.html index.htm; Break ; }
5. Start Nginx (Nginx.exe)
6. Start Django, binding to Nginx.
runfcgi host=127.0.0.1 port=8001method=threaded
7. It ' s done, open a browser, and try http://127.0.0.1:8000