时间:2021-07-01 10:21:17 帮助过:52人阅读
这是后台处理的:
def checkemail(request): user = None if request.POST.has_key('email'): useremail = request.POST['email'] result = {} user = User.objects.filter(useremail__iexact = useremail) if user: result = "1" result = simplejson.dumps(result) else: result = "0" result = simplejson.dumps(result) return HttpResponse(result, mimetype='application/javascript')
这是AJAX部分:
URL的配置是:
希望本文所述对大家的Python程序设计有所帮助。