I am trying to setup a lastuser OAuth server on my machine. So I intend to setup Nginx with SSL ( on 443 ) and lastuser
app as WSGI server.
HasGeek lastuser
I have setup HTTPS/SSL with Nginx and it works fine on my machine.
However the WSGI server is not working.
Lastuser is basically a Flask app with a WSGI script website.wsgi
.
import sys
import os.path
sys.path.insert(0, os.path.dirname(__file__))
from lastuserapp import app as application, init_for
init_for('production')
I tried using gunicorn for WSGI and I get the error ImportError: No module named wsgi
as shown below:
$ gunicorn -b localhost:7000 website.wsgi
2014-03-03 17:06:49 [31267] [INFO] Starting gunicorn 0.13.4
2014-03-03 17:06:49 [31267] [INFO] Listening at: http://127.0.0.1:7000 (31267)
2014-03-03 17:06:49 [31267] [INFO] Using worker: sync
2014-03-03 17:06:49 [31270] [INFO] Booting worker with pid: 31270
2014-03-03 17:06:50 [31270] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/gunicorn/arbiter.py", line 456, in spawn_worker
worker.init_process()
File "/usr/lib/pymodules/python2.7/gunicorn/workers/base.py", line 100, in init_process
self.wsgi = self.app.wsgi()
File "/usr/lib/pymodules/python2.7/gunicorn/app/base.py", line 101, in wsgi
self.callable = self.load()
File "/usr/lib/pymodules/python2.7/gunicorn/app/wsgiapp.py", line 24, in load
return util.import_app(self.app_uri)
File "/usr/lib/pymodules/python2.7/gunicorn/util.py", line 241, in import_app
__import__(module)
ImportError: No module named wsgi
2014-03-03 17:06:50 [31270] [INFO] Worker exiting (pid: 31270)
2014-03-03 17:06:50 [31267] [INFO] Shutting down: Master
2014-03-03 17:06:50 [31267] [INFO] Reason: Worker failed to boot.
So my question is: is there anything I am doing wrong or is it an issue with gnunicorn or the libraries installed on my machine?