Using Ubuntu, Nginx, FastCGI, Python, and DjangoNOTE: No security on the following, this was for development purposes just to learn python and django. From a fresh install of Ubuntu Meerkat (10.10), I added the following packages:
After making sure, python is installed and installing the django framework sdk. I check to make sure django will use fastCGI by running the following: $ cd [path to django project root] $ python manage.py runfcgi host=127.0.0.1 port=8080 --settings=settings And to kill the process: $ pkill -f "python manage.py runfcgi host=127.0.0.1 port=8080 --settings=settings" Next, is to edit nginx configuration, adding the new django site to nginx’s sites-enabled directory: server { listen 80; server_name localhost; location ~* ^.+.(js|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov) { rroot /media/; access_log off; expires 30d; } location / { # host and port to fastcgi server fastcgi_pass 127.0.0.1:8080; fastcgi_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_pass_header Authorization; fastcgi_intercept_errors off; } access_log /var/log/nginx/localhost.access_log main; error_log /var/log/nginx/localhost.error_log; } Then, restarting nginx and then trying to access the site via the regular port 80 access. |
|