Exemplo n.º 1
0
 def clean_domain(self):
     domain = (self.cleaned_data['domain']).strip()
     hosting_domain = who_hosted_this(domain)
     print hosting_domain
     if hosting_domain == None:
         raise forms.ValidationError("Invalid Domain!")
     return domain
Exemplo n.º 2
0
def who_is_hosting(request):
    if request.method == 'POST':
        form = WhoishostingForm(request.POST)
        if form.is_valid():
            fdata =  form.cleaned_data
            domain = fdata['domain'];
            hosting_domain = who_hosted_this(domain)
            lookuptable = HostLookUp(domain = domain,hosted_by = hosting_domain)
            lookuptable.save()
            return render_to_response("hosts/who_hosted.html", {
                "hosted_by": hosting_domain,
            }, context_instance=RequestContext(request))
    else:
        form = WhoishostingForm()
    return render_to_response("hosts/whoishosting.html", {
        "form": form,
           }, context_instance=RequestContext(request))