5
sr('200 OK', [('Content-Type', 'image/png'), ('X-Sendfile', os.path.abspath('logo_uWSGI.png'))])
9
sr('200 OK', [('Content-Type', 'image/png')])
10
return uwsgi.sendfile('logo_uWSGI.png')
12
def serve_options(e, sr):
13
sr('200 OK', [('Content-Type', 'text/html')])
14
for opt in range(0,256):
15
body = "{opt} = {optvalue}<br/>".format(opt=opt, optvalue=uwsgi.get_option(opt))
16
yield bytes(body.encode('ascii'))
18
def serve_config(e, sr):
19
sr('200 OK', [('Content-Type', 'text/html')])
20
for opt in uwsgi.opt.keys():
21
body = "{opt} = {optvalue}<br/>".format(opt=opt, optvalue=uwsgi.opt[opt].decode('ascii'))
22
yield bytes(body.encode('ascii'))
25
routes['/xsendfile'] = xsendfile
26
routes['/logo'] = serve_logo
27
routes['/config'] = serve_config
28
routes['/options'] = serve_options
30
def application(env, start_response):
32
if env['PATH_INFO'] in routes:
33
return routes[env['PATH_INFO']](env, start_response)
35
start_response('200 OK', [('Content-Type', 'text/html')])
38
<img src="/logo"/> version {version}<br/>
42
<iframe src="/config"></iframe><br/>
47
<iframe src="/options"></iframe><br/>
49
""".format(version=uwsgi.version.decode('ascii'))
51
return bytes(body.encode('ascii'))