Django Integration of pgcli

Django web framework has a rich set of management commands. One of them is python 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:

    $ pip install django-pgcli

Then add django_pgcli to the list of INSTALLED_APPS in your project's



Launch the dbshell through the management command.

    $ python dbshell

That will launch pgcli with the appropriate database credentials.

That's it.


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.