MEDIA_ROOT isn't a good solution. It should use a StorageBackend.
For instance, when you use a load-balancer there is no guarantee that
your session hits the same server twice.

-- Gert

Mobile: +32 498725202
Web: http://gert.selentic.net



On Mon, May 31, 2010 at 10:36, Gregor Müllegger <gre...@muellegger.de> wrote:
> Storing the file in a temporary directory is elegant but brings up
> some new problems.
>
> IMO it's critical - if you want to support file uploads - to put these
> files into MEDIA_ROOT. Otherwise you wouldn't be able to show previews
> of uploaded images etc.
>
> 2010/5/30 TiNo <tin...@gmail.com>:
>> On Sat, May 29, 2010 at 22:07, Stephan Jäkel <m...@sjaekel.com> wrote:
>>>
>>> I already discussed this ticket with Jannis during the sprints and hope to
>>> start a discussion here to find the right way to allow file uploads and see
>>> if my approach takes the right direction.
>>
>> Couldn't you just use python's tempfile.NamedTemporaryFile[1]? That way the
>> file will get cleaned by the filesystem itself, unless you move it somewhere
>> else in your ``done`` method. If you pass delete=False, you will be able to
>> open the file again in the last step, as long as you properly closed it
>> before.
>> TiNo
>> [1] http://docs.python.org/library/tempfile.html#tempfile.NamedTemporaryFile
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers" group.
>> To post to this group, send email to django-develop...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-developers+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-developers?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To post to this group, send email to django-develop...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-developers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to