Don't use pgAdmin (or similar tools)

This post is another testament to how much you get for free with Django. On a fairly regular basis I see developers using a tool like pgAdmin or a GUI tool to inspect their database. My general recommendation is to not use those tools by default.

Here's why:

  1. They can allow a developer to edit the schema or otherwise modify the database (eg delete tables) which then creates havoc for the Django migrations system.
  2. Django providers manage.py shell to interact with the database via the ORM. The benefits here are that you have a full Python interpreter and you practice using the ORM functionality which can then be easily copy/pasted to your code.
  3. Django also provides manage.py dbshell to drop into the likes of psql directly. Again this is better than a GUI as you are working through Django which means it will be available on any project in any environment (including a locked down production environment), no special permissions or exceptions required.
  4. Finally if you are using these tools to visualise your database then the django-extensions graph_models command or something like django-schema-viewer has you covered.

Essentially learn to work with the tooling Django provides by default or via third-party packages before reaching for external tooling.

Disclaimer: This doesn't mean these external tools aren't useful, but they have a place and that place shouldn't be in a default setup.