Upload files without form
I need to upload a list of images to a project.
I've found tons of pages about how to upload a file using a
form...(that's clearly written on django official docs) :-)
But i need to do it by a custom django-admin command because i have to
link theese files(900) to respective records in the project
I tryed with shutil.copy too, but it copies files and immediately delete
it. i saw them by file manager in the right folder, but after 1-2
seconds they disappeared.
So i have a list
f[1]='/path/to/source/image1.jpg'
f[2]='/path/to/source/image2.jpg'
f[3]='/path/to/source/image3.jpg'
.
.
f[n]='/path/to/source/imagen.jpg'
and i need to upload to
os.path.join(settings.MEDIA_ROOT, 'images')
Does someone already done it WITHOUT USING FORMS, or can help me...
Thanks to all
Alkatron
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home