This answer quotes ChatGPT
Depending on the information you provided, it may be because you encountered a type error while converting del_d to an integer. Try to convert it to an integer using the following code:
def del(request): del_d = request.GET.get("del") del_id = int(del_d) print(del_id) models.qq_news.objects.filter(id=del_id).delete() return redirect('/data_enter/')
If this doesn't work, you can try using the try and except statements to catch the exception and debug it:
def data_del(request): del_d = request.GET.get("del") try: del_id = int(del_d) except TypeError: print("del_d is not a valid integer.") else: print(del_id) models.qq_news.objects.filter(id=del_id).delete() return redirect('/data_enter/')
Also, you mentioned that there is no problem on Windows, but there is a problem on CentOS. This may be due to differences in the operating system environment. You can try to check whether the Python version and dependency library version you use on CentOS are the same as those on Windows. In addition, you can check your log file or console output to see if there are any additional error messages.