title: Running uwsgi with virtualenv and flask
body: <p>When trying to run my flask application I get the error:</p>
  
  <pre><code>uwsgi no module named site
  </code></pre>
  
  <p>I created a configuration file as such:</p>
  
  <pre><code>[uwsgi]
  socket = 127.0.0.1:8000
  processes = 4
  virtualenv = /var/www/test/venv
  chdir = /var/www/test
  module = run
  callable = manager
  logto = var/www/uwsgi.log
  </code></pre>
  
  <p>The location of my run.py is /var/www/test/run.py with the following code:</p>
  
  <pre><code>from flask.ext.migrate import Migrate, MigrateCommand
  from flask.ext.script import Manager
  from app import app, db
  
  if __name__ == "__main__":
      migrate = Migrate(app, db)
      manager = Manager(app)
      manager.add_command('db', MigrateCommand)
      manager.run()
  </code></pre>
  
  <p>Can anyone help me understand where I have gone wrong please? I am running a system wide UWSGI.</p>
  
  <p><strong>EDIT</strong> </p>
  
  <p>I installed uwsgi and virtualenv using pip and I have the following versions: </p>
  
  <ul>
  <li>uWSGI==2.0.2                                                                                          </li>
  <li>virtualenv==1.11.4</li>
  </ul>
  
  <p>My system wide python version (and the one inside my venv) is: Python 2.7.3</p>