DNS-py2/gui.py
Benjamyn Love e62b756155 Adjusted template (dns.html) for DNS and whois
Adjusted main.py to return values instead of print them
2018-05-13 23:43:59 +10:00

26 lines
763 B
Python

from flask import Flask, render_template, request
import main as dnspy
app = Flask(__name__)
app.config['DEBUG'] = True
@app.route('/', methods=['POST', 'GET'])
def index():
if request.method == 'POST':
data = request.form['domain']
print(data)
dnsinfo, whois = dnspy.lookupDomain(str(data))
#dnsinfo = {"." : "."}
return render_template('dns.html', whois=whois, dnsinfo=dnsinfo)
else:
whois = {"Status" : "Please enter a domain"}
dnsinfo = {"Stub" : "Data"}
return render_template('dns.html', whois=whois, dnsinfo=dnsinfo)
@app.route('/domain/', methods=['POST', 'GET'])
def getDomain():
data = request.form['domain']
return data
if __name__ == '__main__':
app.run(host='0.0.0.0')