0

I need to serve up two webs apps (Django) on gunicorn under different domain names using nginx on ubuntu. I started using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

It worked just fine for one using that. Then I tried to do the same thing for the second but it gives me a 502 gateway for the second domain. So I tried following this tutorial: http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/

I'm at the part where you run the gunicorn start script:

sudo bin/gunicorn_start

I get back the response:

Starting webuildblack as root
    Traceback (most recent call last):
        File "/home/devin/webuildblack/bin/gunicorn", line 7, in <module>
            from gunicorn.app.wsgiapp import run
                ImportError: No module named 'gunicorn.app'; 'gunicorn' is not a package
1
  • 1
    you should check 502 gateway problem first. You could check nginx logs and run django in debug mode to see more information about problem. Sometimes it can be simple problem like problem with database. Commented Oct 30, 2016 at 18:57

1 Answer 1

2

You have named your program gunicorn.py like the gunicorn-package. Rename your this file and remove any gunicorn.pyc file.

Sign up to request clarification or add additional context in comments.

1 Comment

scratch that you were right. I tried that again and it worked after I deleted the pyc file. thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.