[Django]-ReverseSingleRelatedObjectDescriptor object has no attribute 'username'

4👍

I had this traceback, too:

'ReverseSingleRelatedObjectDescriptor' object has no attribute my_attribute

I found the solution:

Comment.user # Access on class level: does raise the above error

comment.user # Access on instance: this works!

Leave a comment