I have model 'Video' and I have a list view for this model, then in another app I'm trying to create a view 'UserVideosListView' that is viewable to the dedicated user. when I open the page in the browser before making any templates for this view I'm able to see current user's videos (not all videos).
# inside 'users' app
class UserVideosListView(ListView):
model = Video
template_name = "users/user_videos.html"
context_object_name = 'videos'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['videos'] = Video.objects.filter(author=self.request.user)
return context
# inside 'videos' app
class VideoListView(ListView):
model = Video
paginate_by = 25
template_name = 'videos/video_list.html'
context_object_name = 'videos'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['videos'] = Video.published_videos.all()
return context
P.S. I'm sure that the URL I'm entering is current, and there is no template inside the 'users' directory