Le lundi 13 février 2017 22:38:37 UTC+1, Alessandro Molina a écrit :
>
>
>
> On Fri, Feb 10, 2017 at 4:23 PM, damien accorsi <[email protected] 
> <javascript:>> wrote:
>
>>
>> I agree with you about creating a tg application context, but a tg 
>> application context is not a tg.request context (the application exists 
>> without a user request, does'nt it ?)
>>
>
> Not really no, the two are pretty much the same. But you shouldn't confuse 
> "having a context, and so a request" with "serving the request".
> You can clearly have a fake request that never gets dispatched and served. 
> In fact `/_test_vars` nearly does that, as the request never reaches the 
> application nor any application wrapper. It stop right after setting up the 
> application context.
>
> If you are facing side effects triggered by the request it might be that 
> you are not running it on the pure TGApp but you are running it in the 
> whole WSGI application wrapped with middlewares, which don't know that 
> /_test_vars is a fake request and will threat it like any other one. 
> Including the SQLAlchemy middleware which will remove the sesion.
>
> I can see that this is more complicated that it should be btw, and I'll 
> try to provide a good way to setup a context without going through the 
> /_test_vars for 2.3.11
>
 
Actually, I feel like we try to use turbogears stuff "as a library" (so not 
in an execution context)... this is probably why it is difficult to 
"understand how to setup tgapp context".

If you decide to develop something for an easier way to setup the context 
without "/_test_vars",  We can help, Alessandro. Let me know what we can do.

Damien

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to