Форум сайта python.su
Помогите, пожалуйста с режимом http сервера в uWSGI
Берем простейшее тестовое приложение из примеров:
def application(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
return ['Hello here']
#uwsgi --uid 80 --gid 80 --http :8080 --wsgi-file test.py
#uwsgi --uid 80 --gid 80 --http :8080 --module test
[pid: 18730|app: 0|req: 1/1] 91.214.128.99 () {36 vars in 612 bytes} [Wed Sep 21 16:58:54 2011] GET / => generated [b]10[/b] bytes in 0 msecs (HTTP/1.1 200) 1 headers in 45 bytes (1 switches on core 0)
#telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.1
HTTP/1.1 200 OK
Content-type: text/html
Connection closed by foreign host.
[pid: 22533|app: 0|req: 1/1] 91.214.128.99 () {36 vars in 612 bytes} [Wed Sep 21 17:27:36 2011] GET / => generated [b]100[/b] bytes in 0 msecs (HTTP/1.1 200) 1 headers in 45 bytes (1 switches on core 0)
Офлайн