Nginx,Uwsgi and Django App Not Found

Xavier: 02 February 2022

I have configured Nginx with uWSGI and Django on CentOS.

Django Directory(contains all my django app): /home

Django Project Directory: /home/hdblog

/home/ contains below:

import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'hdblog.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

And i'm using below command:

/etc/init.d/uwsgi --socket --master --workers 2 --harakiri 30 --disable-logging --daemonize /tmp/daemonize.log --pidfile /tmp/pidfile.txt --vacuum --gid 500 --uid 500 --pythonpath /home/hdblog --module hdapp

Plus,my /etc/nginx/conf.d/default.conf contains to below line:

location / {
         include uwsgi_params;

As you can see everything is ok,but i'm seeing on 80 port

uWSGI Error

Python application not found

How to solve this problem? Thanks.

Charlotte: 02 February 2022

If the module hdapp map to the file /home/, you have to add /home to the pythonpath