1👍
You should use a data bag. And as you store a password there, it should be encrypted data bag. Then you can read data from it in both recipes (postgres and python).
And storing your passwords in attributes also is not a good idea – because they are too exposed.
Source:stackexchange.com