Hi, I love Flask and would like to use it in a small project.
I have an app.py and a module project.py
in app.py I have an index view.
in project.py I use:
mod = Module(__name__, name='projects', url_prefix='/projects')
@mod.route('/',methods = ['GET','POST'])
def index():
if request.method == 'GET':
return render_template('projects.html', projects=projects)
else:
redirect(request.referrer or url_for('.index'))
then it gives "raise ValueError('View function did not return a response')".
Tried to change the code to 'redirect('/')', no help.
any advice is welcome. thanks!
--
Weller
Enjoy everyday life!
redirect(request.referrer or url_for('.index')) here should be return
redirect(request.referrer or url_for('.index')) because redirect is a
response too.
2010/7/18 Weasky <weasky@gmail.com>
> Hi, I love Flask and would like to use it in a small project.
> I have an app.py and a module project.py
> in app.py I have an index view.
> in project.py I use:
>
> mod = Module(__name__, name='projects', url_prefix='/projects')
> @mod.route('/',methods = ['GET','POST'])
> def index():
> if request.method == 'GET':
> return render_template('projects.html', projects=projects)
> else:
> redirect(request.referrer or url_for('.index'))
>
> then it gives "raise ValueError('View function did not return a
> response')". Tried to change the code to 'redirect('/')', no help.
>
> any advice is welcome. thanks!
>
> --
> Weller
> Enjoy everyday life!
>
Thanks! it works perfectly. On Sun, Jul 18, 2010 at 2:31 AM, 何威威 <heww0205@gmail.com> wrote: > redirect(request.referrer or url_for('.index')) here should be return > redirect(request.referrer or url_for('.index')) because redirect is a > response too. > > 2010/7/18 Weasky <weasky@gmail.com> > > Hi, I love Flask and would like to use it in a small project. >> I have an app.py and a module project.py >> in app.py I have an index view. >> in project.py I use: >> >> mod = Module(__name__, name='projects', url_prefix='/projects') >> @mod.route('/',methods = ['GET','POST']) >> def index(): >> if request.method == 'GET': >> return render_template('projects.html', projects=projects) >> else: >> redirect(request.referrer or url_for('.index')) >> >> then it gives "raise ValueError('View function did not return a >> response')". Tried to change the code to 'redirect('/')', no help. >> >> any advice is welcome. thanks! >> >> -- >> Weller >> Enjoy everyday life! >> > >
Hi, anyone used flask-openid on app engine? It could be possible without a filesystem? Carles El 18/07/2010, a las 08:31, "何威威" <heww0205@gmail.com> escribió: > redirect(request.referrer or url_for('.index')) here should be return redirect(request.referrer or url_for('.index')) because redirect is a response too. > > 2010/7/18 Weasky <weasky@gmail.com> > Hi, I love Flask and would like to use it in a small project. > I have an app.py and a module project.py > in app.py I have an index view. > in project.py I use: > > mod = Module(__name__, name='projects', url_prefix='/projects') > @mod.route('/',methods = ['GET','POST']) > def index(): > if request.method == 'GET': > return render_template('projects.html', projects=projects) > else: > redirect(request.referrer or url_for('.index')) > > then it gives "raise ValueError('View function did not return a response')". Tried to change the code to 'redirect('/')', no help. > > any advice is welcome. thanks! > > -- > Weller > Enjoy everyday life! >
Hi, On 7/18/10 1:34 PM, Carles wrote: > Hi, anyone used flask-openid on app engine? It could be possible without > a filesystem? Yes, but you would have to write yourself a custom store. Regards, Armin
Thanks! I'll try. On Sun, Jul 18, 2010 at 1:41 PM, Armin Ronacher <armin.ronacher@active-4.com > wrote: > Hi, > > On 7/18/10 1:34 PM, Carles wrote: > > Hi, anyone used flask-openid on app engine? It could be possible without > > a filesystem? > Yes, but you would have to write yourself a custom store. > > > Regards, > Armin >
App engine users service now has openid built in. Check the docs. Sent via BlackBerry by AT&T -----Original Message----- From: Carles <carlesgm@gmail.com> Sender: flask@librelist.com Date: Sun, 18 Jul 2010 13:34:29 To: <flask@librelist.com> Reply-To: flask@librelist.com Subject: [flask] Flask-Openid app engine Hi, anyone used flask-openid on app engine? It could be possible without a filesystem? Carles El 18/07/2010, a las 08:31, "何威威" <heww0205@gmail.com> escribió: > redirect(request.referrer or url_for('.index')) here should be return redirect(request.referrer or url_for('.index')) because redirect is a response too. > > 2010/7/18 Weasky <weasky@gmail.com> > Hi, I love Flask and would like to use it in a small project. > I have an app.py and a module project.py > in app.py I have an index view. > in project.py I use: > > mod = Module(__name__, name='projects', url_prefix='/projects') > @mod.route('/',methods = ['GET','POST']) > def index(): > if request.method == 'GET': > return render_template('projects.html', projects=projects) > else: > redirect(request.referrer or url_for('.index')) > > then it gives "raise ValueError('View function did not return a response')". Tried to change the code to 'redirect('/')', no help. > > any advice is welcome. thanks! > > -- > Weller > Enjoy everyday life! >
you can have a try about rpx <http://www.janrain.com>