linux install uwsgi test.py test solution does not show hello world

General deploy the project to the server, install uwsgi, but a lot of tutorials when it is installed will let you test the installed yet, so there are many like me senseless force teenager fell into a pit can not get out, for a long time, long time...

That was the last browser enter the ip: port 8000 after the server responds, but the browser is a blank

The reason: Because the test code is python2.x environmental testing, his meow now with python3.x, and actually nobody mention this!

Solve:
python3.x Please look test cases:

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return [b"Hello World"]

As python2.x still the same test on the line:

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return "Hello World"

His meow, though, is a painless non-itchy pit, but does not fill my heart is always uncomfortable, well, now comfortable!

 

Guess you like

Origin www.cnblogs.com/suguangti/p/11330045.html