En primer lugar, aquí está mi guión:errores WSGIServer al intentar ejecutar Django aplicación
#!/usr/bin/python
import sys, os
sys.path.append('/home/username/python')
sys.path.append("/home/username/python/flup")
sys.path.append("/home/username/python/django")
# more path stuff
os.environ['DJANGO_SETTINGS_MODULE'] = "project.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
Como se ha descrito here.
Y aquí está el error que consigo al intentar ejecutarlo desde la shell:
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Status: 404 NOT FOUND
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<!-- more html which looks to be the correct output -->
Mi pregunta es, ¿por qué no son los parametros pasados automáticamente por FastCGI? ¿Qué estoy haciendo mal? Ejecutar el script desde mi servidor web solo me da un error interno del servidor.
En lugar de las dos últimas líneas de mi guión, puedo usar
from flup.server.fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
WSGIServer(WSGIHandler()).run()
Pero todavía obtener el mismo error exacto ...
¿Por qué no estás usando mod_wsgi? –
@ S.Lott: Un par de años tarde, pero estaba en un host compartido. No tuve acceso a WSGI. – mpen