For future reference -- my problem was a render_to_string
inside a view function, causing the context processor to be executed twice:
comments = render_to_string('comments.html', {'comments': comments_list}, request)
This call was cached, so it was kinda difficult to identify where the problem was. Anyway, I solved it by removing the request context from the render_to_string
call, since I didn't need it for this particular case:
comments = render_to_string('comments.html', {'comments': comments_list})
Later on I refactored the code and removed the render_to_string
all together, and cached the snippet directly in the template. But there are legit cases for using render_to_string
inside a view function (such as rendering an email template for example), so this may cause some issues.