#!/usr/bin/env python

import tempfile
import subprocess

import web

urls = ("/camera", "Camera")
app = web.application(urls, globals())


class Camera(object):
    def GET(self):
        with tempfile.NamedTemporaryFile(suffix=".jpg") as tfp:
            process = subprocess.Popen(["picamera", "-o", tfp.name])
            stdout, stderr = process.communicate()

            if process.returncode:
                raise Exception((stdout, stderr))

            web.header("Content-Type", "image/jpeg")
            return tfp.read()


if __name__ == "__main__":
    app.run()


@@ -283,16 +283,18 @@
 n(%5B%22
-picamera
+raspistill
 %22, %22
@@ -429,16 +429,36 @@
 eption((
+process.returncode, 
 stdout, 

Use raspistill and provide some additional error info