Created
February 10, 2013 05:48
-
-
Save iambibhas/4748546 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.core.files import File | |
| from django.core.files.temp import NamedTemporaryFile | |
| img_temp = NamedTemporaryFile(delete=True) | |
| img_temp.write(urllib2.urlopen(url).read()) | |
| img_temp.flush() | |
| im.file.save(img_filename, File(img_temp)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment