title: WSGIServer errors when trying to run Django app
body: <p>Firstly, here's my script:</p>
  
  <pre><code>#!/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")
  </code></pre>
  
  <p>As was described <a href="http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache" rel="noreferrer">here</a>.</p>
  
  <p>And here's the error I get when trying to run it from shell:</p>
  
  <pre><code>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
  
  
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html lang="en"&gt;
  &lt;!-- more html which looks to be the correct output --&gt;
  </code></pre>
  
  <p>My question is, why aren't those params passed automatically by FastCGI? What am I doing wrong? Running the script from my web server just gives me an internal server error.</p>
  
  <hr>
  
  <p>Instead of the last two lines of my script, I can use </p>
  
  <pre><code>from flup.server.fcgi import WSGIServer
  from django.core.handlers.wsgi import WSGIHandler
  WSGIServer(WSGIHandler()).run()
  </code></pre>
  
  <p>But I still get the exact same error...</p>