Hi Aaron,
Sorry for my late answer, I was on holidays, what about
instance.url()? (that's the recommended way to do, .path() is for
local storages)
Regards,
David
> Thanks David, but it seems awkward to call
>
> avatar.image.storage.url(str(avatar.image))
>
> to retrieve the URL for an ImageField.
> Do you have a better way?
avatar.image.url should work (without parenthesis, that's a property).
I propose to continue the discussion as private, I don't want to flood
that list with custom apps.
David
PS: note to self, add more examples in documentation...
I think you may be correct on that my tip was incorrect. Forget what
I said! :-)
Have you tried getting the url like avatar.image.url? I use a line
like this in some of my code that uses S3Storage and it works.
image_url = my_model_instance.image.url.replace ( ':80', '' )
On Jan 19, 4:01 pm, "Aaron Lee" <waifun...@gmail.com> wrote:
> Thanks for your tip, I believe your suggestion will end up having my.jpg
> under
> my-bucket-name.s3.amazonaws.com.s3.amazonaws.com/userprofile/my.jpg
>
> I think the AWS_STORAGE_BUCKET_NAME should just be userprofile