Почему я получаю страницу приветствия NGINX вместо моего приложения Django
Я развернул свое приложение Django на сервере VPS. Я настроил NGINX и uWSGI сервер.
Здесь представлена моя конфигурация Nginx
# the upstream component nginx needs to connect to
upstream django {
server unix:///root/PIDC/ProjetAgricole/ProjetAgricole.sock; # for a file socket
# server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 8000;
# the domain name it will serve for
server_name my_public_IP_address; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /root/PIDC/ProjetAgricole/media;
}
location /static {
alias /root/PIDC/ProjetAgricole/static;
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include /root/PIDC/ProjetAgricole/uwsgi_params;
}
}
Здесь находится мой файл mysite_uwsgi.ini
# mysite_uwsgi.ini file
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /root/PIDC/ProjetAgricole
# Django's wsgi file
module = project.wsgi
# the virtualenv (full path)
home = /root/my_project/venv
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 10
# the socket (use the full path to be safe
socket = /root/PIDC/ProjetAgricole/ProjetAgricole.sock
# ... with appropriate permissions - may be needed
# chmod-socket = 664
# clear environment on exit
vacuum = true
Когда я запускаю приложение Django с uwsgi и nginx с помощью этой команды:
uwsgi --socket ProjetAgricole.sock --module ProjetAgricole/ProjetAgricole.wsgi --chmod-socket=664
В результате выполнения команды я получаю следующий результат:
(venv) root@vmi851374:~/PIDC/ProjetAgricole# uwsgi --socket ProjetAgricole.sock --module ProjetAgricole/ProjetAgricole.wsgi --chmod-socket=664
*** Starting uWSGI 2.0.20 (64bit) on [Sun Apr 24 18:57:17 2022] ***
compiled with version: 9.4.0 on 17 April 2022 18:54:03
os: Linux-5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022
nodename: vmi851374.contaboserver.net
machine: x86_64
clock source: unix
detected number of CPU cores: 4
current working directory: /root/PIDC/ProjetAgricole
detected binary path: /root/my_project/venv/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 31601
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address ProjetAgricole.sock fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x55d5d758ada0
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72904 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
ModuleNotFoundError: No module named 'ProjetAgricole/ProjetAgricole'
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 327968, cores: 1)
Когда я запускаю свое приложение через веб-браузер, оно отображает страницу приветствия NGINX вместо главной страницы моего проекта, которая должна отображаться.
Есть ли ошибки в конфигурационных файлах?
Пожалуйста, помогите
