Hi i am making a website that detects phishing websites but when ever i open my code to see if it works that file run and then closes yall plz help

hi i am making a website that detects phishing websites but whenever i open my code to see if it works that file runs and then closes and also how do I add this code to a HTML file so I can make it a website my code is in python
here is my code

import flask
from flask import Flask, render_template, request
from sklearn.externals import joblib
import inputScript
import regex

import sys
import logging


app = Flask(__name__)

app.logger.addHandler(logging.StreamHandler(sys.stdout))
app.logger.setLevel(logging.ERROR)


@app.route('/')
@app.route('/index')
def index():
    return flask.render_template('home.html')

@app.route('/about')
def about():
    return flask.render_template('about.html')

@app.route('/predict', methods = ['POST'])
def make_prediction():
    classifier = joblib.load('rf_final.pkl')
    if request.method=='POST':
        url = request.form['url']
        if not url:
            return render_template('home.html', label = 'Please input url')
        elif(not(regex.search(r'^(http|ftp)s?://', url))):
            return render_template('home.html', label = 'Please input full url, for exp- https://facebook.com')
        
        
        checkprediction = inputScript.main(url)
        prediction = classifier.predict(checkprediction)

        if prediction[0]==1 :
            label = 'website is not legitimate'
        elif prediction[0]==-1:
            label ='website is legitimate'
        
        return render_template('home.html', label=label)
        
        
if __name__ == '__main__':
    classifier = joblib.load('rf_final.pkl')
    app.run()s
    import os # Set environment variables os. environ['API_USER'] = 'username' os. environ['API_PASSWORD'] = 'secret' # Get environment variables USER = os