我一直在关注使用nginx和Gunicorn设置Django的数字海洋教程。我用Python 3.4运行Ubuntu 14.04。
我在Gunicorn的步骤和" gunicorn projectsyfa.wsgi:application"命令无效。我迷失了该怎么做。
在/ home / ubuntu / myenv / bin / projectsyfa中运行它只会停止。没有错误消息或任何东西。它就像尝试做某事一样,但我会在那里坐一会儿,什么都不会出现。
在/ home / ubuntu / myenv / bin / projectsyfa / projectsyfa中运行它给了我
Exception in worker process:
Traceback (most recent call last):
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/arbiter.py", line 502, in spawn_worker
worker.init_process()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/workers/base.py", line 114, in init_process
self.wsgi = self.app.wsgi()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/app/base.py", line 66, in wsgi
self.callable = self.load()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/util.py", line 356, in import_app
__import__(module)
ImportError: No module named 'projectsyfa.wsgi'
Traceback (most recent call last):
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/arbiter.py", line 502, in spawn_worker
worker.init_process()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/workers/base.py", line 114, in init_process
self.wsgi = self.app.wsgi()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/app/base.py", line 66, in wsgi
self.callable = self.load()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/util.py", line 356, in import_app
__import__(module)
ImportError: No module named 'projectsyfa.wsgi'
Traceback (most recent call last):
File "/home/ubuntu/myenv/bin/gunicorn", line 9, in <module>
load_entry_point('gunicorn==19.0.0', 'console_scripts', 'gunicorn')()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/app/base.py", line 166, in run
super(Application, self).run()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/app/base.py", line 71, in run
Arbiter(self).run()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/arbiter.py", line 169, in run
self.manage_workers()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/arbiter.py", line 477, in manage_workers
self.spawn_workers()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/arbiter.py", line 537, in spawn_workers
time.sleep(0.1 * random.random())
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/arbiter.py", line 209, in handle_chld
self.reap_workers()
File "/home/ubuntu/myenv/lib/python3.4/site-packages/gunicorn/arbiter.py", line 459, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
我的目录如下:
/home/ubuntu/myenv/bin/projectsyfa/projectsyfa# ls
__init__.py __pycache__ settings.py urls.py wsgi.py
/home/ubuntu/myenv/bin/projectsyfa# ls
manage.py projectsyfa
非常感谢任何帮助。