Auto image resizing/compressing using python/django
Have multiple copies on the same image on different resolution on the server, and serve the correct one according to screen size using CSS media queries
I'm working on a responsive website that uses Django and a lot of the content is static. Most of this content are photos of high resolution and because of this, it takes too much time to load. 
Is there any way (using python/django) to make it so that to load such an image, a server request is made and then a function automatically resizes the image to the size that it needs to be (bigger for a desktop, smaller for a smartphone, etc) or compresses the image so that it doesn't take so much time to load?