django-smuggler icon indicating copy to clipboard operation
django-smuggler copied to clipboard

Support to import/export user uploaded data (from the default media storage)

Open semente opened this issue 12 years ago • 5 comments

semente avatar Nov 22 '13 20:11 semente

Do you mean image and files for this?

It's an interesting and tough task-- b/c it requires going beyond django's built-in dumpdata and loaddata.

pconerly avatar Aug 19 '14 17:08 pconerly

Yep, I mean the media files that usually are stored in the MEDIA_ROOT directory of the file system. But actually I think we should consider that the user might be using a different backend for storage.

semente avatar Aug 19 '14 18:08 semente

Maybe limit support to storage backends that support the listdir and path. That would make implementing this a bit easier.

Since user uploaded media might be extremely large you'd also need to use a streaming response to which you would write a zipfile.

Not sure if this is all possible, but those would probably be the building blocks.

It would also be nice to be able to pick which directories/files to download. So you can pick and choose what you need.

jaap3 avatar Aug 21 '14 09:08 jaap3

@jaap3 :+1:

semente avatar Aug 21 '14 12:08 semente

Got a implementation of dumping the defaultstorage to a tgz file going in a branch on my clone https://github.com/jaap3/django-smuggler/tree/dump-storage

Creating zipfiles as a stream is too hard unless I use an external dependency, so I decided not to support it.

Haven't worked on loading dumps yet. A thing to remember is to make sure they are really only extracted into the storage dir.

Since StreamingHttpResponse isn't available on Django 1.4 this would mean dropping support for 1.4.

jaap3 avatar Aug 29 '14 14:08 jaap3