Fix redirecting to the current page after logging in
Fix redirecting the user to the current page after logging out
Add missing import on urlparse
Set the next argument on the log out button