You don't need the db.Blob for ndb - just use self.profile_photo = image.
Here's a very quick example:
class TestBlobModel(ndb.Model):
img = ndb.BlobProperty()
class Test(webapp2.RequestHandler):
def get(self):
image_id = self.request.get('id')
if image_id:
m = TestBlobModel.get_by_id(long(image_id))
self.response.headers['content-type'] = 'image/png'
self.response.out.write(m.img)
else:
self.response.out.write("""
<form enctype="multipart/form-data" action="/test" method="POST">
<input type="file" name="image" />
<input type="submit" />
</form>""")
def post(self):
img_data = self.request.get('image')
m = TestBlobModel()
m.img = img_data
m.put()
html = '<a href="/test?id=%s">View your image</a>' % m.key.id()
self.response.out.write(html)