Example #1
0
def index():
    form = LoginForm()
    show_predictions_modal=False
    if form.validate_on_submit():
        _prediction = get_prob([form.domain.data])  
        form.whois = get_whois(form.domain.data)
        if _prediction == -1:
            form.prediction = "invalid (contains invalid characters)"
        elif _prediction > 0.5:
            form.prediction = "dga ({0:.2f})".format(_prediction)
        else:
            form.prediction = "legit ({0:.2f})".format(_prediction)
        return render_template('bootstrap.html', show_predictions_modal=True, form=form)
    return render_template('bootstrap.html', show_predictions_modal=False, form=form)