linux部署python web项目 详细_linux下nginx+python+uwsgi部署总结(django+web.py)

f76b63bf1d36b8a8d0fdd9085b61e94c.png

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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值