def storeImages(request): if request.method == 'POST': urlDictList = json.loads(request.POST['urlDictList']) for imgInfo in urlDictList: storage.storeImage(imgInfo) return HttpResponse(u'<htm><body>store images ok</body></html>') else: return HttpResponse(u'<htm><body>store images</body></html>')
def storeImagesByGet(request, url): storageUrl = storage.storeImage(url) return HttpResponse(u'<html><body>store images ok, return:%s</body></html>' % storageUrl)