[Twisted-Python] woven authentications and connections.

Donovan Preston dp at twistedmatrix.com
Mon Oct 6 10:36:32 EDT 2003


On Oct 6, 2003, at 4:17 AM, Syver Enstad wrote:

> Donovan Preston <dp at twistedmatrix.com> writes:
>
>> On Oct 3, 2003, at 4:47 AM, Syver Enstad wrote:
>>
>>>
>>> I am in the process of implementing authentication for an intranet
>>> application using woven. I will be storing the login information in
>>> the session. On each request I will connect to the database and pass
>>> the connection to the page handling the request. How do I know when
>>> the request is finished so that I can close the connection?
>>
>> Overriding Page.pageRenderComplete should be what you want.
>
> Thanks, I found another way by calling request.notifyFinished which
> returns a deferred, I then add a callback to that deferred and it
> seems to work fine. *The following is not a rethorical question, I am
> just curious.* In what way is overriding Controller.pageRenderComplete
> superior to my solution?

It's not. Your solution is superior. :-) Thanks for pointing it out.

dp





More information about the Twisted-Python mailing list