I have a django app and trying to set it up with gunicorn first and later with supervisor and nginx.
The app is running with the normal django command perfectly like
You don't showed a full output. It's probably looks like
$ gunicorn elcarweb.wsgi
[2015-10-27 21:01:47 +0000] [5429] [INFO] Starting gunicorn 19.2.1
[2015-10-27 21:01:47 +0000] [5429] [INFO] Listening at: http://127.0.0.1:8000 (5429)
[2015-10-27 21:01:47 +0000] [5429] [INFO] Using worker: sync
[2015-10-27 21:01:47 +0000] [5434] [INFO] Booting worker with pid: 5434
[2015-10-27 21:01:47 +0000] [5434] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 503, in spawn_worker
worker.init_process()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/workers/base.py", line 116, in init_process
self.wsgi = self.app.wsgi()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
__import__(module)
ImportError: No module named elcarweb.wsgi
Traceback (most recent call last):
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 503, in spawn_worker
worker.init_process()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/workers/base.py", line 116, in init_process
self.wsgi = self.app.wsgi()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
__import__(module)
ImportError: No module named elcarweb.wsgi
[2015-10-27 21:01:47 +0000] [5434] [INFO] Worker exiting (pid: 5434)
Traceback (most recent call last):
File "/home/tomek/Elcar/elcarweb/env/bin/gunicorn", line 11, in
sys.exit(run())
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/app/base.py", line 189, in run
super(Application, self).run()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
Arbiter(self).run()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 170, in run
self.manage_workers()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 473, in manage_workers
self.spawn_workers()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 537, in spawn_workers
time.sleep(0.1 * random.random())
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 210, in handle_chld
self.reap_workers()
File "/home/tomek/Elcar/elcarweb/env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 455, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer:
Last trackback is almost the same, but before You see required informations:
ImportError: No module named elcarweb.wsgi
If You see this error, then solution is run gunicorn with --chdir=/your/app/dir
parameter.