if can_login and not is_blacklisted and form.is_valid():

                if not redirect or ' ' in redirect or (
                        '//' in redirect and re.match(r'[^\?]*//', redirect)):
                    redirect = settings.LOGIN_REDIRECT_URL