wsgithumb provide some utilities to efficiently serve files and images for WSGI based applications. Check the documentation