Django settings when using pgbouncer

前端 未结 2 2015
一向
一向 2021-02-15 21:33

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:08

    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.

提交回复
热议问题