1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > linux部署python web项目 详细_linux下nginx+python+uwsgi部署总结(django+web.py)

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

时间:2018-09-29 08:04:15

相关推荐

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

ara on 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 ] ***

compiled with version: 4.6.1 on 24 October 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 , 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 ] GET / => generated 30432 bytes in 81 msecs (HTTP/1.1 500) 1 headers in 63 bytes (2 switches on core 0)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。