Django settings when using pgbouncer

前端 未结 2 579
不知归路
不知归路 2021-02-15 22:00

I have a Django website with Postgresql backend, for which I\'m utilizing pgbouncer for db connection pooling (transaction mode).

The application and the DB

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-15 22:28

    All of your DB settings in settings.py should be identical to the settings in your pgbouncer config, except the host in settings.py will point to pgbouncer. You probably need to change 'NAME': 'pgbouncer' to 'NAME': 'db1'. Since you're using a unix socket the port shouldn't matter.

提交回复
热议问题