Answer the question
In order to leave comments, you need to log in
Why Django view ajax function doesn't want to work with cyrillic text (live search)?
@api_view(['POST', ])
def live_search(request):
if request.method == 'POST':
key = request.data['key']
result = Event.objects.filter(title__istartswith=key)
events = serializers.serialize('json', result)
print (key)
print (result)
data = {
'events': events,
}
return Response(data)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question