Thursday, July 28, 2011

Re: Django admin upload image to few folders

I've been working on using django-filetransfers.

Curious whether it works well for you.

My current challenge is that I want to use the index as the file name
for the url rather than the pk. Anyone have an idea how to do that

I'm thinking this is a simple question about databases in django.

Thank you in advance,


class UploadModel(models.Model):
file = models.FileField(upload_to='uploads/%Y/%m/%d/%H/%M/%S/')

class UploadForm(forms.ModelForm):
class Meta:
model = UploadModel

from filetransfers.api import serve_file

def download_handler(request, pk):
upload = get_object_or_404(UploadModel, pk=pk)
return serve_file(request, upload.file)

On Jul 23, 1:17 am, Vusal Alishov <> wrote:
> Hello, I want to upload image in django-admin interface to few
> folders.
> My models image field such: image =
> models.ImageField(upload_to='images')
> How can I do it?

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment