[Answered ]-'str' object does not support item assignment – with Django

2👍

You should have provided the full traceback.

However, I think the issue is with your if user.is_anonymous check – if it’s true, you return an empty string. But the return value of an inclusion tag must always be a context dict. You should return an empty dict there instead.

Leave a comment