How to not show password in clear text when connecting to postgres via sqlalchemy, psycopg2?
- 阅读更多 关于 How to not show password in clear text when connecting to postgres via sqlalchemy, psycopg2?
问题 I'm currently connecting to a Postgres db from a Python script and I'm using sqlalchemy with psycopg2: postgresql+psycopg2://user:password@host:port/dbname[?key=value&key=value...] This Python script is available to users, and the password is shown in clear text. How can I use an encrypted password instead? 回答1: Generally, this is done in a few different ways. 1. Hide your database behind a REST API Basically, don't make the database directly accessible to users. Provide an interface like a