Updated app.py

made the method in login work correctly, mysql with app.py