librelist archives

« back to archive

Re: [flask] Re: flask-oauth and blueprints

Re: [flask] Re: flask-oauth and blueprints

From:
Wouter Bolsterlee
Date:
2013-03-19 @ 07:50
Perhaps you could try the before_first_request hook. It runs before the 
first request is served, but within an application context.

    — Wouter

Alexis Georges <alexis.georges@gmail.com>schreef:

>Hi Steven,
>
>
>I tried that but I received an error saying that I was not running within
an application context (on the go, and don't have the exact error 
message). I figure that is because, as in Armin's oauth example, I am 
creating the remote_app outside of a request handler.
>
>On Tuesday, March 19, 2013, Steven Kryskalla wrote:
>
>On Tue, Mar 19, 2013 at 12:12 AM, Alexis Georges
><alexis.georges@gmail.com> wrote:
>> I am having a problem with setting up the google remote_app inside of a
>> blueprint however, since I don't have access to the app's config in which I
>> am storing the CLIENT_ID and CLIENT_SECRET.
>
>Try using flask.current_app:
>
>http://flask.pocoo.org/docs/api/#flask.current_app
>