title: Running python under nginx
body: <p>I'm at a loss here...</p>
  
  <p>I'm trying to use uwsgi to run my flask app. Using the example at <a href="http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html#the-first-wsgi-application" rel="nofollow">WSGI Quick Start</a> I get it to run.</p>
  
  <p>For development (restserver.py):</p>
  
  <pre><code> from api import app
  
   if __name__ == '__main__':
       app.run(debug=True, port=8080)
  </code></pre>
  
  <p>How would I start the uwsgi server with this?</p>
  
  <p>I have tried this (restserver.fcgi):</p>
  
  <pre><code>#!/usr/bin/python
  from flup.server.fcgi import WSGIServer
  from api import app
  
  if __name__ == '__main__':
      WSGIServer(app, bindAddress='/var/run/fcgi.sock').run()
  </code></pre>
  
  <p>but when reading more I see that uwsgi want's to call the method <code>application</code> by default. I can change that of course but I don't have and <code>application</code> method so when running:</p>
  
  <pre><code>/usr/local/bin/uwsgi --http :9090 --wsgi-file restserver.fcgi
  </code></pre>
  
  <p>I get the following message in the start log:</p>
  
  <pre><code>unable to find "application" callable in file restserver.fcgi
  </code></pre>