Hi All,
I am working on a Google app engine project where I have saved some images in the datastore. Now I have to resize these images and render them to the template. I have successfully fetched the images but I am not getting,how to render them with other data dictionaries to the template. I am using App engine patch with GAE.
Following is a code snippet that I am using in my view:
def getData(request,key):
forum = Topic.get(key)
picData = forum.creator.portfolio_set
response = ''
if picData:
picture = picData[0].userpic
response = HttpResponse(picture, mimetype="image/jpeg")
#response['Content-Type'] = 'image/jpeg'
response['Content-Disposition'] = 'inline'
return render_to_response(request,"forum.html",{"forum":forum,"pic":response })
Now, I am able to render the data within forum variable but not getting how to render the image associated with it. What should I modify in my views file and what should I use in my template to display the image rendered by the views file.
Please suggest.
Thanks in advance.