Whenever I comment
mydb = connector.connect(host="harshitrathore3.mysql.pythonanywhere-services.com", user='harshitrathore3', password="Harshit1", database = 'contact')
mydb.close()
this 2 line the code work fine but not work with these 2 lines my code below //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
from flask import Flask, request
from mysql import connector
app = Flask(__name__)
@app.route('/', methods=['GET'])
def home_page():
return "pls go to login/signup page to login or signup"
@app.route("/login/", methods=['GET'])
def login_page():
mydb = connector.connect(host="harshitrathore3.mysql.pythonanywhere-services.com", user='harshitrathore3', password="Harshit1", database = 'contact')
mydb.close()
return "server successfully runner"