I got this code that works to make active search. I have it working but the problem is that it cannot search well. If it's a small letter and you type capital it doesn't recognize. It is case sensitive. How can I make it case insensitive???
@require_http_methods(['POST'])
def search(request):
res_todos = []
search = request.POST['search']
if len(search) == 0:
return render(request, 'todo.html', {'todos':[]})
for i in list(Persons.objects.values()):
if search in i['title']:
res_todos.append(i)
return render(request, 'todo.html', {'todos': res_todos})