简体   繁体   中英

django fastcgi can't run

I use fastcgi to run a django application. The command I use to run it is as follows:

python manage.py runfcgi method=threaded host=127.0.0.1 port=3035

If I input ps -ef|grep python I can see the thread also, but when i use lynx localhost:3035 to open it, I get a 504 gateway timeout.

So instead, now I use

python manage.py runserver 3035

and it runs OK. I don't know the reson. In the past, I use django 1.2 and it was OK.

my server info:

debian5.0, django1.3, python2.6

The FastCGI protocol is different from HTTP protocol. You need to add some layer talking both HTTP and FastCGI protocols, between lynx and devserver. For example nginx w/ FastCGI module configured.

If deploy with nginx, the better choices are gunicorn or uwsgi(supported natively by nginx).

gunicorn:

http://gunicorn.org/run.html

uwsgi

http://projects.unbit.it/uwsgi/wiki/Example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM