◾️ 'AnonymousUser' object is not iterable
=> answer
Subscription.objects.filter(user=self.request.user) require login-user.
so, we need to check login using @method_decorator(login_required, 'get')
@method_decorator(login_required, 'get')
class SubscriptionListView(ListView):
model = Article
context_object_name = 'article_list'
template_name = 'subscribeapp/list.html'
paginate_by = 10
def get_queryset(self):
projects = Subscription.objects.filter(
user=self.request.user).values_list('project')
article_list = Article.objects.filter(project__in=projects)
# print(f"projects:{projects} ---- article_list:{article_list}")
return article_list