[Twisted-Python] question : Twistar

gelin yan dynamicgl at gmail.com
Fri Jul 15 12:58:07 EDT 2011


hi...

  you can try to use host to indicate which server you want to connect
with.. like:

adbapi.ConnectionPool('xxx', host='localhost', user='twww',pwd='eee')



On Wed, Jul 13, 2011 at 9:08 AM, bino oetomo <bino at indoakses-online.com>wrote:

> Dear All ..
>
> Base on a need, I need to build a JSON-RPC to Postgres "bridge".
> For now, I try to take the ORM way, so I'm looking for ORM "engine" that
> work well with Twisted and support for Postgres as it's backend.
>
> First try I look into SqlAlchemy ... but there is a lot of talk that
> SqlAlchemy did not work well with Twisted.
> I found that Twistar have a support for postgres backend.
>
> All sample script I found only look like this :
> for MySQL driver
> ---Start----
> from twisted.enterprise import adbapi
> from twistar.registry import Registry
>
> Registry.DBPOOL = adbapi.ConnectionPool('MySQLdb', user="twistar",
> passwd="apass", db="twistar")
> ---Stop----
>
> and I thing for postgres it will be like :
> ---Start----
> from twisted.enterprise import adbapi
> from twistar.registry import Registry
>
> Registry.DBPOOL = adbapi.ConnectionPool('psycopg2', user="twistar",
> passwd="apass", db="twistar")
> ---Stop----
>
> Is that right ?
> If So ... where to put the db server ip address (i.e : my Postgres
> server is at 192.168.10.232) ?
>
> Sincerely
> -bino-
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20110716/8520576a/attachment.htm 


More information about the Twisted-Python mailing list