Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
sys.path.append('/home')
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 127.0.0.1:8889 --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;
         uwsgi_pass 127.0.0.1:8889;
    }

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.

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.