K
K
kkomissarov2019-10-01 17:20:08
Django
kkomissarov, 2019-10-01 17:20:08

Why can't UWSGI see a Django app?

I do not know how to solve this problem further, uwsgi tells me that my application is not there:

--- no python application found, check your startup logs for errors ---
[pid: 707|app: -1|req: -1/6] 89.235.190.56 () {38 vars in 585 bytes} [Tue Oct  1 12:31:59 2019] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

Here is my ini file through which all this should work:
[uwsgi]
chdir           = /home/kkomissarov/bot/project

# Django wsgi файл
module          = main_app.wsgi

# полный путь к виртуальному окружению
home            = /home/kkomissarov/bot/venv

# общие настройки
# master
master          = true
# максимальное количество процессов
processes       = 10
# полный путь к файлу сокета
socket          = /home/kkomissarov/bot/project/project.sock
# права доступа к файлу сокета
chmod-socket    = 664

# очищать окружение от служебных файлов uwsgi по завершению
vacuum          = true

#Рестарт при обновлении файла
touch-reload    = /home/kkomissarov/bot/log/reload

#Время жизни процессов
max-worker-lifetime = 600
harakiri = 600

When I try to open it in a browser, I get an Internal Server Error message. The path to the virtual environment is correct, if it is deliberately made incorrect, instead of a message, I get a standard 502 error. The name of the application has already been checked a hundred times, the path to the project too. How else can you figure out what's going on?
If you run the development server on some port like python manage.py runserver 0.0.0.0:8000 it works.
There is such a line in the settings WSGI_APPLICATION = 'main_app.wsgi.application'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Guest007, 2019-10-02
@Guest007

I don't use chdir, but specify (although I have XML format)

<wsgi-file>/home/kkomissarov/bot/project/config/wsgi.py</wsgi-file>
<pythonpath>/home/kkomissarov/bot/project</pythonpath>
<pythonpath>/home/kkomissarov/bot/project/config/</pythonpath>
<module>wsgi</module>

Something like this...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question