1👍
✅
profile
is a queryset, not an instance. Querysets don’t have a slug
attribute.
You either need to get a specific instance of Profile in your extra method, or iterate through the profiles in your template.
0👍
The fact that [<Profile: Red>]
is visible in the test output indicates that you are passing Profile
instance to the template correctly.
Therefore the problem lies within profile.slug
. Are you sure that you have slug
field on your Profile
class?
- [Answer]-Django ORM: All items not in table
- [Answer]-Turndjango class based view dispatch ValueError
- [Answer]-Making queries for a single row table in Django
- [Answer]-Python Django Logging Issue
Source:stackexchange.com