Django Gunicorn ImportError: no module named django.core.wsgi

I created a Django application, but now I have plans to use some asynchronous (real-time) functions in some areas of the site. After some research, I think I should use gevent-socketio , and therefore I need to switch the application server to Gunicorn .

I encountered the first obstacle to deploying Gunicorn , I installed using the sudo apt-get install gunicorn and try to run my application with gunicorn project.wsgi:application , but it does not work and causes the following error:

 Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 473, in spawn_worker worker.init_process() File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 100, in init_process self.wsgi = self.app.wsgi() File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 115, in wsgi self.callable = self.load() File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 33, in load return util.import_app(self.app_uri) File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 362, in import_app __import__(module) File "/home/alex/django_projects/fantasymatchday_1/fantasymatchday_1/wsgi.py", line 13, in <module> from django.core.wsgi import get_wsgi_application ImportError: No module named django.core.wsgi 2014-11-20 17:31:45 [6605] [INFO] Worker exiting (pid: 6605) 2014-11-20 17:31:45 [6600] [INFO] Shutting down: Master 2014-11-20 17:31:45 [6600] [INFO] Reason: Worker failed to boot. 

Can someone give me a clue on what I need to do from here?

I am using python 3.4.0 and Django 1.6

+5
source share
1 answer

You need to install django and gunicorn in the same environment.
If you are using virtualenv , make sure you have both in the same virtual environment.

+1
source

Source: https://habr.com/ru/post/1207331/


All Articles