def solve_text_android(request): #print "post:....." #print request.POST #print "files....." #print request.FILES if request.method =="POST": #text = request.POST['text'] text = "hello" results2 = text_image_f2(text) print results2 image_data = open(results2,"rb").read() return HttpResponse(image_data,content_type="image/jpg")
def image_image_android(request): global saved_url global results if request.method=="POST": form=ModelFormWithFileField(request.POST,request.FILES) print 'upload:...' print request.FILES if form.is_valid(): form.save() img=Picture.objects.order_by('-id')[0] print img saved_url=img.original_image.url print 'save: '+saved_url text = "image_image" results2 = text_image_f2(text) print results2 image_data = open(results2,"rb").read() print type(image_data) return HttpResponse(image_data,content_type="image/jpg")