Я пытаюсь настроить uwsgi для моего проекта Django. Он прекрасно работает сuWSGI + Django + Python: нет модуля с именем uwsgi
./manage.py runserver 0.0.0.0:9010
Но когда я пытаюсь
uwsgi --http :9010 --chdir /home/user/appname --module wsgi --wsgi-file /home/user/appname/appname/wsgi.py
Я получаю
ImportError: No module named wsgi
Что я делаю не так?
Вот полный лог:
uWSGI http bound on :9010 fd 4
spawned uWSGI http 1 (pid: 1900)
uwsgi socket 0 bound to TCP address 127.0.0.1:42684 (port auto-assigned) fd 3
Python version: 2.7.9 (default, Mar 1 2015, 13:01:26) [GCC 4.9.2]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1c17310
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72760 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
ImportError: No module named wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)
Traceback (most recent call last):
File "/home/robert/surmaroute/surmaroute/wsgi.py", line 13, in <module>
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 1899, cores: 1)
Это вызывает проблему, потому что, очевидно, ваше приложение не имеет модуля 'wsgi'. Это модуль, который uwsgi пытается импортировать, чтобы найти ваше приложение. Основываясь на приведенной выше структуре, вы можете захотеть что-то вроде '--module appname.wsgi', но вам может и не понадобиться, поскольку у вас есть' --wsgi-file', указанный – Suever