I am trying to keep track of a user avatar for all of my users. I have added an imageField to my user model. I also have a facebook login and if a user logs in with facebook I am happy just using their profile pic as the avatar and letting facebook host this, but I would also like users that don't login with facebook to upload an avatar. The problem is that when I try to save directly to the ImageField like this:
model:
avatar = models.ImageField(upload_to='avatars/%Y/%m/%d', default="", blank=True)
in view:
info.avatar = 'http://graph.facebook.com/555555/picture/'
then it saves the url relative to the media url so when I try to load it I get this for the avatar.url:
http://domain.com/media/https%3A//graph.facebook.com/555555/picture/
Which is obviously not what I want. Is there any way to save them both in the same field or am I forced to create two separate fields, a profile_pic_url field and an avatar field?