When a user registers for my app.I receive this error when he reaches the profile page.
The \'image\' attribute has no file associated with it. Exception Typ
The better approach which would not violate DRY is to add a helper method to the model class like:
@property def image_url(self): if self.image and hasattr(self.image, 'url'): return self.image.url
and use default_if_none template filter to provide default url: