4👍
✅
You can access the categories with this
{% for category in post.categories.all %}
{{ category.title }}
{% endfor %}
I also recommend adding .prefetch_related('categories')
to the queryset in your view to reduce the number of sql queries.
Source:stackexchange.com