gopalraha
By:
gopalraha

How to bind adress with gunicorn default Django Askbot App

July 28, 2016 605 views
Django Python Frameworks Ubuntu 16.04

I have completed all the steps to install the Askbot Django Apps to but struck on gunicorn steps.

Postgres + Nginx + Gunicorn + Askbot on Ubuntu 16.04

I follow this articles

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

and struck on Testing Gunicorn's Ability to Serve the Project step

this is binding step. please help me to resolve this issues

2 comments
  • Can you provide more details on where you are getting stuck exactly? Do you get any errors?

  • When i have run this command i have stuck on this

    # gunicorn --bind 139.59.24.83:8000 wsgi:application
    

    Sample Output

    [2016-07-28 12:51:57 +0000] [26688] [INFO] Starting gunicorn 19.4.5
    [2016-07-28 12:51:57 +0000] [26688] [INFO] Listening at: http://139.59.24.83:8000 (26688)
    [2016-07-28 12:51:57 +0000] [26688] [INFO] Using worker: sync
    [2016-07-28 12:51:57 +0000] [26693] [INFO] Booting worker with pid: 26693
    [2016-07-28 12:51:57 +0000] [26693] [ERROR] Exception in worker process:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 515, in spawn_worker
        worker.init_process()
      File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 122, in init_process
        self.load_wsgi()
      File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 130, in load_wsgi
        self.wsgi = self.app.wsgi()
      File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
        self.callable = self.load()
      File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
        return self.load_wsgiapp()
      File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
        return util.import_app(self.app_uri)
      File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 366, in import_app
        __import__(module)
      File "/root/wsgi.py", line 15, in <module>
        from django.core.wsgi import get_wsgi_application
    ImportError: No module named django.core.wsgi
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 515, in spawn_worker
        worker.init_process()
      File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 122, in init_process
        self.load_wsgi()
      File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 130, in load_wsgi
        self.wsgi = self.app.wsgi()
      File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
        self.callable = self.load()
      File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
        return self.load_wsgiapp()
      File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
        return util.import_app(self.app_uri)
      File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 366, in import_app
        __import__(module)
      File "/root/wsgi.py", line 15, in <module>
        from django.core.wsgi import get_wsgi_application
    ImportError: No module named django.core.wsgi
    [2016-07-28 12:51:57 +0000] [26693] [INFO] Worker exiting (pid: 26693)
    [2016-07-28 12:51:57 +0000] [26688] [INFO] Shutting down: Master
    [2016-07-28 12:51:57 +0000] [26688] [INFO] Reason: Worker failed to boot.
    

    Here is my DIR structure

    ├── askbot
    │   ├── cron
    │   └── upfiles
    ├── django.wsgi
    ├── __init__.py
    ├── log
    │   └── askbot.log
    ├── manage.py
    ├── myproject
    │   ├── manage.py
    │   └── myproject
    │       ├── __init__.py
    │       ├── settings.py
    │       ├── urls.py
    │       └── wsgi.py
    ├── settings.py
    ├── urls.py
    ├── wsgi.py
    └── wsgi.pyc
    

    please provide me complete solutions that works.

    Thanks..

Be the first one to answer this question.