def get(request): try: domain = request.POST['domain'] requested = True except: return render(request, 'aaaa/index.html') requested = False if isValidDomain(domain) == False: return render(request, 'aaaa/get.html', { 'invalid': True, 'domain': domain }) ar = a.getRecord(domain, "ipv6") context = {'domain': domain, 'flag': requested, 'records': ar} return render(request, 'aaaa/get.html', context)
def get(request): try: domain = request.POST['domain'] requested = True except: return render(request, 'whoisrec/index.html') requested = False if isValidDomain(domain) == False: return render(request, 'whoisrec/get.html', { 'invalid': True, 'domain': domain }) ar = who.getRecord(domain) if ar.table == []: ar = None context = {'domain': domain, 'flag': requested, 'records': ar} return render(request, 'whoisrec/get.html', context)
def get(request): try: domain = request.POST['domain'] requested = True except: return render(request, 'blacklist/index.html') requested = False if check.isValidDomain(domain) == False and check.isValidIPv4( domain) == False: return render(request, 'blacklist/get.html', { 'invalid': True, 'domain': domain }) if check.isValidIPv4(domain): rec = bl.getRecord(domain, False) else: rec = bl.getRecord(domain) context = {'domain': domain, 'flag': requested, 'records': rec} return render(request, 'blacklist/get.html', context)
def getfile(request): domains = [] if request.method == "POST": newform = fileForm(request.POST, request.FILES) if newform.is_valid(): inputFile = newform.cleaned_data['file_location'] inputFile.seek(0) data = inputFile.read() for d in data.split(): if isValidDomain(d): domains.append(d) else: newform = fileForm() else: return render(request, 'a/index.html') if len(domains) == 0: return render(request, 'a/index.html', {'invalid': True}) dom_json = json.dumps(domains) context = {'domains': domains, 'dom_json': dom_json} return render(request, 'a/get_multiple.html', context)