Django run sql query on the command line

Content

Run SQL query using Django database settings. Pipe commands to dbshell (PostgreSQL, MySQL, SQLite, Oracle).

cat ~/query.sql | python manage.py dbshell