gunicorn,django ImportError:没有名为application的模块

时间:2018-03-12 22:02:15

标签: python django gunicorn

有人可以帮忙吗?我最近合并了迁移,然后运行manage.py migrate,遇到错误,删除了迁移,因为我不需要它们(我最终没有使用的模型)。现在我遇到了这个错误。有人可以帮忙吗?我在其他地方搜索过,没有找到任何有同样错误的人。这只是手动运行代码(如下所示)。我的整个网站有一个502错误的网关错误;我想这与你在下面看到的内容有关

♥root@ubuntu-2gb-nyc3-01:/home/mike/movingcollage#gunicorn --bind=unix:/home/mike/movingcollage/movingcollage.sock movingcollage.wsgi.application --preload
/usr/local/lib/python2.7/dist-packages/djstripe/__init__.py:23: UserWarning: dj-stripe deprecation notice: Django 1.7 and lower are no longer
supported. Please upgrade to Django 1.8 or higher.
Reference: https://github.com/pydanny/dj-stripe/issues/275
  warnings.warn(msg)
Traceback (most recent call last):
  File "/usr/local/bin/gunicorn", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 74, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 185, in run
    super(Application, self).run()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 71, in run
    Arbiter(self).run()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 57, in __init__
    self.setup(app)
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 113, in setup
    self.app.wsgi()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app
    __import__(module)
ImportError: No module named application

1 个答案:

答案 0 :(得分:3)

你的意思是:

$ gunicorn --bind=... movingcollage.wsgi:application