Don't provide multiple methods -
only to then check the method:
if request.method == 'POST':
Instead, separate this into two functions each accepting one method each and remove your if.
home is quite long and needs to be subdivided into multiple subroutines.
Avoid newline-escapes such as this:
balance_query = db_session....