ara on 2011年10月24日 17:23 #
按您文章进行了配置,出现错误,请教问题原因
nginx.conf 配置:
server { # python/uwsgi
listen 80;
root /home/chenkai/webpytest;
error_log /home/chenkai/webpytest/nginx.log;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9090;
index index.html index.htm;
}
}
index.py内容:
import web
urls=('/(.*)','hello')
class hello:
def GET(self):
return 'Hello,world!'
app=web.application(urls,globals())
application=app.wsgifunc()
用uwsgi -s 127.0.0.1:9090 -w index -d uws.error启动
出现错误uws.error:
*** Starting uWSGI 1.0-dev (32bit) on [Mon Oct 24 17:13:38 2011] ***
compiled with version: 4.6.1 on 24 October 2011 16:31:58
current working directory: /home/chenkai/webpytest
detected binary path: /usr/local/bin/uwsgi
*** WARNING: you are running uWSGI without its master process manager ***
your memory page size is 4096 bytes
uwsgi socket 0 bound to TCP address 127.0.0.1:9090 fd 4
Python version: 2.7.2+ (default, Oct 4 2011, 20:29:37) [GCC 4.6.1]
Python main interpreter initialized at 0x91c9b78
your server socket listen backlog is limited to 100 connections
*** Operational MODE: single process ***
WSGI application 0 (mountpoint='') ready on interpreter 0x91c9b78 pid: 3717 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 3717, cores: 1)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/web.py-0.36-py2.7.egg/web/application.py", line 237, in process
return self.handle()
File "/usr/local/lib/python2.7/dist-packages/web.py-0.36-py2.7.egg/web/application.py", line 228, in handle
return self._delegate(fn, self.fvars, args)
File "/usr/local/lib/python2.7/dist-packages/web.py-0.36-py2.7.egg/web/application.py", line 409, in _delegate
return handle_class(cls)
File "/usr/local/lib/python2.7/dist-packages/web.py-0.36-py2.7.egg/web/application.py", line 385, in handle_class
return tocall(*args)
TypeError: GET() takes exactly 1 argument (2 given)
[pid: 3717|app: 0|req: 1/1] 60.55.159.142 () {40 vars in 638 bytes} [Mon Oct 24 17:13:46 2011] GET / => generated 30432 bytes in 81 msecs (HTTP/1.1 500) 1 headers in 63 bytes (2 switches on core 0)