简体   繁体   中英

serve multiple gunicorn django instances under nginx ubuntu

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM