Converted to PEP8. Added profile redirect on login attempt while already logged in.