1👍
✅
In your view you can check like this:
filename = self.request.GET.get('filename')
if FileIndex.objects.filter(filename=filename).exists():
#do something
Source:stackexchange.com