姜戈的头像
我需要在我的应用程序中实现头像。我看到有 django-avatar 但也许还有其他解决方案。如果它们太大,我需要上传新的头像并将其调整为标准分辨率。
尖端?
I need to implement avatar in my application. I see there's django-avatar but maybe there are other solutions. I need upload new avatars and resize it to a standard resolution if they're too big.
Tips?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我用 django-avatar 解决了。
I solved with django-avatar.
您可以尝试 django-avatar-crop。
You can try django-avatar-crop.
使用 django-gravatar 使用 gravatar 非常简单。就我个人而言,我讨厌向每个网站上传新的个人资料图片...
显示用户头像的 40x40 缩略图的示例用法:
Using gravatar is really easy with django-gravatar. Personally I hate uploading new profile images to every single site...
Example usage to display 40x40 thumbnail of the user's gravatar:
如果您主要关心的是处理图像大小和分辨率,您应该看看这两个包:
easy-thumbnails 附带一个
ThumbnailerImageField
,可以自动为您调整上传图像的大小。If your main concern is handling the image size and resolution you should take a look at these two packages:
easy-thumbnails comes with a
ThumbnailerImageField
that automatically resizes an uploaded image for you.