Phần sau dường như truyền một chuỗi thay vì giá trị boolean. Làm thế nào tôi sẽ vượt qua một boolean?Làm cách nào để chuyển boolean từ javascript sang python?
$.post('/ajax/warning_message/', {'active': false}, function() {
return
});
def warning_message(request):
active = request.POST.get('active')
print active
return HttpResponse()
Tôi sẽ đề nghị những điều sau đây để dễ đọc 'active = request.POST.get ('active', False) == 'true'' – JazzyWhit