Automatically loading uploaded files from production Django server
What I'm looking for is a piece of Django middleware that catches a FileNotFound exception and attempts to rsync the file from the production webserver. This way you can develop your site with a copy of production data without having to continually rsync down all the uploaded files.
I'm sure I've seen a solution to this problem on the internets, but hours of Googleing have so far produced nothing. Anyone know of where to f开发者_如何学Cind this?
The code I'd seen before is this:
http://menendez.com/blog/using-django-as-pass-through-image-proxy/
which doesn't catch the FileNotFound error, but the Http404 error, and then loads images from the live server. Unfortunately this doesn't fix the issue of FileNotFound when trying to read images off disk (for sizes etc).
精彩评论