Django web framework has a rich set of management commands. One of them is
python manage.py dbshell. This will launch the default database repl and connect to the appropriate database for the web application.
Now it is possible to launch
pgcli instead of the default
psql for Postgres by installing the django-pgcli python package.
Install it using
$ pip install django-pgcli
django_pgcli to the list of INSTALLED_APPS in your project's settings.py.
INSTALLED_APPS = [ ..., 'django_pgcli', ]
dbshell through the management command.
$ python manage.py dbshell
That will launch pgcli with the appropriate database credentials.
My personal thanks to Ash Christopher for taking the initiative to create this package. It was a well requested feature of pgcli, you just made a lot of people happy.