I have configured Nginx with uWSGI and Django on CentOS.

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

Django Project Directory: /home/hdblog

/home/hdapp.py 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.


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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy