【发布时间】:2017-03-12 22:59:16
【问题描述】:
我需要在 ubuntu 上使用 nginx 在 gunicorn 上以不同的域名提供两个网络应用程序 (Django)。我开始使用本教程: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
对于使用它的人来说效果很好。然后我尝试为第二个域做同样的事情,但它为我提供了第二个域的 502 网关。所以我尝试按照本教程进行操作: http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/
我正在运行 gunicorn 启动脚本的部分:
sudo bin/gunicorn_start
我收到回复:
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
【问题讨论】:
-
你应该先检查
502 gateway问题。您可以检查 nginx 日志并在调试模式下运行 django 以查看有关问题的更多信息。有时它可能是简单的问题,例如数据库问题。
标签: python django ubuntu nginx