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

Avatar upload/display issue...

Open chrisvoncsefalvay opened this issue 7 years ago • 3 comments

Having delved a little deeper into the avatar upload issue, I think I've figured out what's going wrong, although I don't have the time to debug the whole thing - I do hope @grantmcconnaughey will get around to it!

So: when I upload an avatar from http://mysite.com/avatar/change, it will look for the image (say, call it avatar2.png) at http://mysite.com/avatar/change/avatars/1/resized/80/avatar2.png, rather than the media directory, which is http://mysite.com/media/avatars/1/resized/avatar2.png. I think this seems to stem from an error where the relative in-media path of the image (/avatars/1/resized/80/avatar2.png) is appended not to the MEDIA_ROOT URI but to the current URI. Which is not cool, but should be very easy to fix - sadly I am not familiar enough with the codebase to be able to do this but someone like @grantmcconnaughey should be able to fix this in a jiffy ;)

Thanks ;)

chrisvoncsefalvay avatar Aug 22 '16 11:08 chrisvoncsefalvay

Hey @chrisvoncsefalvay. When you say "the avatar upload issue" it sounds like there is an issue I don't know about. Is there another GitHub issue that this is referencing?

Also, are you receiving an error? If so, please post a Traceback.

Which versions of django-avatar and Django are you using?

grantmcconnaughey avatar Sep 03 '16 15:09 grantmcconnaughey

I had the same issue on a fresh django project. I think you need to set MEDIA_URL. MEDIA_ROOT is where django stores your uploads, MEDIA_URL is prepended when constructing URLs.

reidransom avatar Oct 29 '16 14:10 reidransom

the same issue here. the images are successfully upload and saved in the dir media/avatars/..., but somehow the pictures not show.

further problem is that if it's a gravatar user login, all users pictures are the same as gravatar user; else if no uploaded picture, show gravatar default picture for all users; else show no picture to any users.

c-shan avatar May 08 '20 08:05 c-shan

If the issue is as described by @reidransom then that is a general django installation question, not django-avatar specific. Please reopen if it is something else.

johanneswilm avatar Aug 16 '22 10:08 johanneswilm