Actually code:
def app(environ, start_response): start_response('200 OK', [('Content-type', 'text/html')]) with codecs.open("template.html", 'r', 'utf8') as template_file: template_content = template_file.read() return template_content And an empty server response
GET / => generated 0 bytes in 1 msecs (HTTP/1.1 200) 1 headers in 44 bytes (1105 switches on core 0) The document is empty. If template_content is replaced with u "Hello" - the same. "Hello" - the answer is normal.
return str (template_content) gives an encoding error
UnicodeEncodeError: 'ascii' codec can't encode characters in position 82-86: ordinal not in range(128) Checked on uwsgi and wsgiref.simple_server