[Twisted-web] Using Twisted with django

Ram Peters rampeters at gmail.com
Mon Mar 12 18:33:12 CST 2007


I think I am understanding it now, Twisted handles request for you.
So you don't need Apache + Mod_Python.  You just have to put in a loop
and tell Twisted to listen to the port.

For example, I just tell it to listen to some port.

def main():
        factory = protocol.ServerFactory()
        factory.protocol = Echo
        reactor.listenTCP(5555,factory)
        reactor.run()
if _name_=='_main_':
        main()

On 12/03/07, Jean-Paul Calderone <exarkun at divmod.com> wrote:
> On Mon, 12 Mar 2007 16:36:10 -0400, Ram Peters <rampeters at gmail.com> wrote:
> >Some where in the documentation, I read you can do blocking stuff like
> >access to database using twisted.enterprise.adbapi.
>
> Yes.  But does Django use this? :)
>
> >I don't really
> >see, why, anyone want to use Twisted for other than writing their on
> >communication protocol like BitTorrent.
>
> Some people find it easier than writing threaded code.  Other people need
> better performance than threaded solutions can provide.  Other people want
> to use some protocol which has a Twisted implementation.
>
> Jean-Paul
>
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
>



More information about the Twisted-web mailing list