The 'avatar' attribute has no file associated with it

Hi,
when I create a new user in django admin panel.The thrown error is:
Traceback (most recent call last):
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/db/models/options.py”, line 565, in get_field
return self.fields_map[field_name]
KeyError: ‘get_avatar’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/contrib/admin/utils.py”, line 262, in lookup_field
f = _get_non_gfk_field(opts, name)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/contrib/admin/utils.py”, line 293, in _get_non_gfk_field
field = opts.get_field(name)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/db/models/options.py”, line 567, in get_field
raise FieldDoesNotExist("%s has no field named ‘%s’" % (self.object_name, field_name))
django.core.exceptions.FieldDoesNotExist: Avatar has no field named ‘get_avatar’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/core/handlers/exception.py”, line 34, in inner
response = get_response(request)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/core/handlers/base.py”, line 145, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/core/handlers/base.py”, line 143, in _get_response
response = response.render()
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/response.py”, line 106, in render
self.content = self.rendered_content
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/response.py”, line 83, in rendered_content
content = template.render(context, self._request)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/backends/django.py”, line 61, in render
return self.template.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 171, in render
return self._render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 163, in _render
return self.nodelist.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 937, in render
bit = node.render_annotated(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 904, in render_annotated
return self.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/loader_tags.py”, line 150, in render
return compiled_parent._render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 163, in _render
return self.nodelist.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 937, in render
bit = node.render_annotated(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 904, in render_annotated
return self.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/loader_tags.py”, line 150, in render
return compiled_parent._render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 163, in _render
return self.nodelist.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 937, in render
bit = node.render_annotated(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 904, in render_annotated
return self.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/loader_tags.py”, line 62, in render
result = block.nodelist.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 937, in render
bit = node.render_annotated(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 904, in render_annotated
return self.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/loader_tags.py”, line 62, in render
result = block.nodelist.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 937, in render
bit = node.render_annotated(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/base.py”, line 904, in render_annotated
return self.render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/contrib/admin/templatetags/base.py”, line 33, in render
return super().render(context)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/template/library.py”, line 214, in render
_dict = self.func(*resolved_args, **resolved_kwargs)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/contrib/admin/templatetags/admin_list.py”, line 339, in result_list
‘results’: list(results(cl)),
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/contrib/admin/templatetags/admin_list.py”, line 315, in results
yield ResultList(None, items_for_result(cl, res, None))
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/contrib/admin/templatetags/admin_list.py”, line 306, in init
super().init(*items)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/contrib/admin/templatetags/admin_list.py”, line 229, in items_for_result
f, attr, value = lookup_field(field_name, result, cl.model_admin)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/contrib/admin/utils.py”, line 271, in lookup_field
value = attr(obj)
File “/home/cipher/environment/admin/lib/python3.6/site-packages/avatar/admin.py”, line 24, in get_avatar
‘url’: avatar_in.avatar.url,
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/db/models/fields/files.py”, line 61, in url
self._require_file()
File “/home/cipher/environment/admin/lib/python3.6/site-packages/django/db/models/fields/files.py”, line 38, in _require_file
raise ValueError(“The ‘%s’ attribute has no file associated with it.” % self.field.name)
ValueError: The ‘avatar’ attribute has no file associated with it.
[21/Jan/2020 08:09:24] “GET /admin/avatar/avatar/ HTTP/1.1” 500 307459

Looks like you are missing a field in model definition. Relevant code needed for a more specific answer.

You can see this early in the traceback… The rest looks like traceback for a failed field lookup within Django’s API.