librelist archives

« back to archive

facing problems with redirect.

facing problems with redirect.

From:
Mahesh Lal
Date:
2012-06-21 @ 08:50
Hi,

I was trying to get a redirect working and wrote something like
redirect(url_for('login')).

Login is a registered blueprint and can be accessed as a url.

Please advise.

-- 
*-- REGARDS*
*

MAHESH LAL*
*
*

Re: [flask] facing problems with redirect.

From:
Malphas Wats
Date:
2012-06-21 @ 09:06
On Thu, Jun 21, 2012 at 9:50 AM, Mahesh Lal <mahesh.2910@gmail.com> wrote:
> Hi,
>
> I was trying to get a redirect working and wrote something like
> redirect(url_for('login')).
>
> Login is a registered blueprint and can be accessed as a url.
>
> Please advise.

Hi,

  If your login() function is declared in the access_control blueprint
(for example), you would need to redirect it like this:

    redirect(url_for('access_control.login'))

  so Flask knows where to look.