During my application I sometimes produce a new picture. After reading through comments here I made the decision to keep the images within the filesystem and also the metadata within the database, now my files are offered statically individually from the database (the bd provides the user the filename that they would like to access, that they then pull from the static fileserver).
However, the issue I've here's which i don't always want customers to determine pictures produced by other customers. Let us say, for instance, that user Joe produces pictures A and B, and user Sue produces C and D. I'm not going Joe seeing C and D and that i dont want Sue visiting a and B. Since all of the files are offered statically, if Joe transpires with guess the url for C, he is able to can get on.
Since how a pictures are offered is virtually unmanageable of my django, I am unsure exactly what the solution here could be, apart from encrypting the files (that is complicated and resource-intensive)
Use a number of MD5 hexdigest of some attribute included in the image path the road is going to be pretty random.
The easiest way is by using django send_file to get it done. This really is simple to apply but doesn't scale well. I personally use it for everyone dynamically produced reviews. The only real benefit of this option would be it's all python code.
The greater way is by using the data on sanmai's links. You may also have a look here: http://www.sensibledevelopment.com/2010/11/django-sendfile-an-for-abstraction-large-file-serving-in-django/ for many django specific information.