Assuming we have apache server running, and chart that we want to display is /var/www/images/foo_chart.png,
we place display_chart.py python script in /var/www/cgi-bin.
The script is:
#!/usr/bin/python if __name__ == "__main__": print "Content-type: image/png\n" print file(r"/var/www/images/foo_chart.png", "r").read()
Now, in web browser we type
and the page with our chart should be pulled up.
Instructions to install and start apache server can be found here.
Note: to get apache server working you need to allow port 80 for HTTP. This is easily done through amazon web-services personal account page -> dashboard -> security groups.