Do anyone here use Python *embedded* in a database?
Joshua Kugler
joshua at joshuakugler.com
Wed Aug 5 15:26:48 EDT 2009
Jonathan Fine wrote:
> Hi
>
> I'm writing a talk that compares embed and extend, and wondered if
> anyone here ever used the Python *embedded* in a database server.
> http://twistedmatrix.com/users/glyph/rant/extendit.html
>
> Web frameworks (such as Django) use extend, to import an extension
> module that makes a connection to a database.
>
> If you have used embed, you might have consulted a page such as:
> http://www.postgresql.org/docs/8.3/interactive/plpython-funcs.html
>
Yes, I've used plpython. We had a web application that had account creation
logic with salting, encryption, etc, on the passwords. We then wanted to
use the same accounts to log in to a Drupal site. Instead of trying to
replicate the logic in PHP, I just created a stored procedure with
plpython, and we overrode the drupal login check to call something
like "SELECT check_account(user, pass)" which would return 1 or 0 on
success or failure, respectively. Worked great.
j
More information about the Python-list
mailing list