Skip to content

test of pgbouncer with postgresql version > 13 with default scram and a django app

Notifications You must be signed in to change notification settings

GuillaumeCisco/testpgbouncer

Repository files navigation

Test pgbouncer with django and postgres 15

TL;DR

For scram, use rmccaffrey/pgbouncer:latest image. In production with kubernetes for example, make sure to use 127.0.0.1 instead of localhost as the database host.

Build django docker image

$> docker build -f docker/app/Dockerfile -t djangoapp/server:latest .

Launch docker-compose + migrations

$> # with md5
$> docker-compose -f docker-compose-md5.yml up -d && DATABASE_URL=postgres://db:password@localhost:5532/db python manage.py migrate
$> # with scram
$> docker-compose -f docker-compose-scram.yml up -d && DATABASE_URL=postgres://db:password@localhost:5532/db python manage.py migrate

Run migrations alone

$> DATABASE_URL=postgres://db:password@localhost:5532/db python manage.py migrate

Test

Go to localhost:8001/admin and try to authenticate, it should NOT hang, and you should get an error message as superuser was not yet created.

Clean

$> docker-compose down && sudo rm -rf postgres-data

About

test of pgbouncer with postgresql version > 13 with default scram and a django app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published