2013-10-20 9 views
5

मैं Django ऐप को तैनात करने के लिए uwsgi का उपयोग कर रहा हूं। मैं एप्लिकेशन के तहत पहुँचा जा करना चाहते हैं:uwsgi के साथ Django ऐप कैसे माउंट करें?

SERVER_URL:PORT/APP_NAME 

मेरी uswgi विन्यास हैं:

[uwsgi] 
http=:PORT 
threads = 10 
die-on-term=true 
chdir = /dir/to/my/app/ 
home = /dir/to/my/app/ 
logto = /dir/to/log/LOG.log  
wsgi-file = /dir/to/my/app/main_package/wsgi.py 
mount = /APP_NAME=/dir/to/my/app/main_package/wsgi.py 

मैं माउंट काम करने के लिए नहीं मिल सकता है। मुझे ऐप SERVER_URL:PORT के तहत मिलता है और SERVER_URL:PORT/APP_NAME के तहत नहीं।

लॉग मुझे मिलता हैं:

*** Starting uWSGI 1.9.14 (64bit) on [Sun Oct 20 11:12:49 2013] *** 
compiled with version: 4.6.3 on 15 October 2013 13:08:46 
os: Linux-3.2.0-29-generiC#46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 
nodename: SERVER_URL 
machine: x86_64 
clock source: unix 
detected number of CPU cores: 1 
current working directory:/
detected binary path: /dir/to/my/app/bin/uwsgi 
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 15886 
your memory page size is 4096 bytes 
detected max file descriptor number: 1024 
building mime-types dictionary from file /etc/mime.types...530 entry found 
lock engine: pthread robust mutexes 
uWSGI http bound on :8016 fd 4 
spawned uWSGI http 1 (pid: 21029) 
uwsgi socket 0 bound to TCP address 127.0.0.1:60322 (port auto-assigned) fd 3 
Python version: 2.7.3 (default, Apr 10 2013, 06:31:07) [GCC 4.6.3] 
Set PythonHome to /dir/to/my/app/ 
Python main interpreter initialized at 0x22c6830 
python threads support enabled 
your server socket listen backlog is limited to 100 connections 
your mercy for graceful operations on workers is 60 seconds 
mapped 165584 bytes (161 KB) for 10 cores 
*** Operational MODE: threaded *** 
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x22c6830 pid: 21028 (default app) 
mounting /dir/to/my/app/main_package/wsgi.py on /APP_NAME 
WSGI app 1 (mountpoint='/APP_NAME') ready in 0 seconds on interpreter 0x276e1b0 pid: 21028 
*** uWSGI is running in multiple interpreter mode *** 
spawned uWSGI worker 1 (and the only) (pid: 21028, cores: 10) 

मैं भी uswgi विन्यास से wsgi-file हटाना चाहते हैं और केवल mount विन्यास छोड़ने के लिए कोशिश की। मुझे मिल गया:

mounting /dir/to/my/app/main_package/wsgi.py on /APP_NAME 
WSGI app 0 (mountpoint='/APP_NAME') ready in 0 seconds on interpreter 0x24ae780 pid: 11515 (default app) 

और फिर भी एप्लिकेशन को सही ढंग से माउंट नहीं किया गया था।

मैं अपना ऐप कैसे माउंट करूं?

पीएस मैं nginx का उपयोग करने से बचना चाहता हूं।

+1

अधिक लॉग plz आप WSGI फाइल की जरूरत नहीं है तक uWSGI बताने की आवश्यकता .. – yakiang

+0

मूल में जोड़ा संदेश – Tamar

+0

कोई विचार नहीं, या तो .. आशा है [यह] (https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/uwsgi/) पृष्ठ मदद करता है ... btw मुझे लगता है कि 'nginx' कोशिश करने लायक है । – yakiang

उत्तर

5

nginx uWSGI को सही SCRIPT_NAME (और PATH_INFO) पास नहीं कर सकता है। आप --manage-पटकथा नाम

साथ अपने आप में अनुवाद करने के लिए जिस तरह से माउंट पहले से ही लोड करता है के रूप में यह

संबंधित मुद्दे