import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'Purgesys.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
uwsgi 启动应用
uwsgi -s : 9000 -w django.py
错误信息:
*** Starting uWSGI 1.2-rc3 (64bit) on [Wed May 2 11:43:10 2012] ***
compiled with version: 4.1.2 20080704 (Red Hat 4.1.2-4 on 01 May 2012 14:16:56
detected number of CPU cores: 2
current working directory: /opt/osqa/Purgesys
detected binary path: /usr/sbin/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 memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uwsgi socket 0 bound to TCP address :36530 (port auto-assigned) fd 3
Python version: 2.5.1 (r251:54863, May 1 2012, 14:14:04) [GCC 4.1.2 20080704 (Red Hat 4.1.2-4]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x798fa80
your server socket listen backlog is limited to 100 connections
*** Operational MODE: single process ***
File "./django.py", line 2
os.environ['DJANGO_SETTINGS_MODULE'] = 'Purgesys.settings'
^
IndentationError: unexpected indent
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 29694, cores: 1)