On Sat, 2006-08-05 at 15:54 -0400, Todd O'Bryan wrote: > It seems that requests for some way to store binary data in the > database is a perennial request. I've seen comments (I think Adrian > said it "opens a can of mutated worms."), but never a real > discussion of what the problems would be. > > There's a recent ticket, #2417, that adds support for "small-ish" > bits of binary data using a BinaryField. It uses the VARBINARY type > in MySQL, which is limited to 64k bytes of data. It also subclasses > CharField, so it will show up in the Admin, which may or may not be a > good idea.
It sounds like a bad idea to me. Attempting to display random binary data as a string doesn't sound that useful and although the security issues are solvable, they aren't necessarily easy. [...] > Yes, this will be slower than having Apache serve the file directly, > but it has the huge advantage that the file is served as the result > of a view. That means you can do all kinds of interesting permission > checking, url mapping, and general futzing around internal to Django, > without having to interact with whichever web server you're using. I'm not a big fan of this idea, so I'm not going to address the details (although it does make me think that we need a documented way of extending fields so that people can do this without needing to dive into the core and so that this stuff can be shipped independently of Django). However, this paragraph needs correcting. You can *already* serve files through views and take advantage of Django's permissions system. The HTTP interfaces can take iterables as their source for output, so a well-designed wsgi server should have no real memory problems with a well-designed iterator. Or if somebody wants to store their static files on another system entirely, you can do that with redirects (which could be internal) and views and custom header (with encrypted token) as well. The only thing we can't do internally at the moment is do direct filehandle passing or anything like that. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~----------~----~----~----~------~----~------~--~---
