views.py
def index():
    """This function allows to execute the login; if user is already logged in , he will able to access the main page"""
    global data
    if "logged_in" in session and session["logged_in"] == True:
        print("User login",session["username"])
        try:
            count1 = managedb.getCountLoginDB(session["username"])
            if count1 == 0:
                session.clear()
                return render_template('loginPage.html',data=data)
            return redirect(url_for('main'))
        except Exception as e:
            print("Error DB:",str(e))
            return render_template('loginPage.html', data=data)
    return render_template('loginPage.html',data=data)
This function allows to execute the login; if user is already logged in , he will able to access the main page
This function allows to execute the login; if user is already logged in , he will able to access the main page
This function allows to execute the login ; if user is already logged in he will able to access the main page
def index():
    global data
    if "logged_in" in session and session["logged_in"] == True:
        print("User login",session["username"])
        try:
            count1 = managedb.getCountLoginDB(session["username"])
            if count1 == 0:
                session.clear()
                return render_template('loginPage.html',data=data)
            return redirect(url_for('main'))
        except Exception as e:
            print("Error DB:",str(e))
            return render_template('loginPage.html', data=data)
    return render_template('loginPage.html',data=data)
def index ( ) : global data if "logged_in" in session and session [ "logged_in" ] == True : print ( "User login" , session [ "username" ] ) try : count1 = managedb . getCountLoginDB ( session [ "username" ] ) if count1 == 0 : session . clear ( ) return render_template ( 'loginPage.html' , data = data ) return redirect ( url_for ( 'main' ) ) except Exception as e : print ( "Error DB:" , str ( e ) ) return render_template ( 'loginPage.html' , data = data ) return render_template ( 'loginPage.html' , data = data )
This function allows to execute the login; if user is already logged in , he will able to access the main page
This function allows to execute the login ; if user is already logged in he will able to access the main page
"""This function allows to execute the login; if user is already logged in , he will able to access the main page"""