Closed skorokithakis closed 4 years ago
Thanks @skorokithakis I think those are both reasonable suggestions. I'm curious to know more about your particular use case. Are you using another library to generate the default user icons?
Yes, exactly. I'm using http://avatars.adorable.io/, which needs a random parameter to generate deterministic avatars. I also wanted to use Robohash, but since Gravatar strips query parameters, I optimized the other way and used Robohash falling back to Gravatar when a Gravatar exists.
Cool, yeah, I like this idea so long as it can be kept reasonably generic. Are you interested in submitting a pull request?
Sure, I can take a stab at it soon. I've mostly implemented it for my service anyway.
That'd be awesome. I haven't done much Django development lately but I could take a stab at it if need be.
There are services that generate "default" user icons based on their name, email, etc. The current
GRAVATAR_DEFAULT_IMAGE
setting cannot use these services.I propose two things:
gravatar
template tag be changed to accept a "default image URL" argument.GRAVATAR_DEFAULT_IMAGE
be changed to accept either a string (the current behavior), or a callable which will be called with the tag's parameters and will return a URL for the fallback image. That way, we can specify a function that will accept email/size/etc and will return a URL for the default image for the user.