こちらの記述を参考にしました。
Djangoのユーザをシェルで確認する方法
GUI で見ると次のように見えるユーザーをシェルで確認します。
manage.py のあるフォルダーで次のように実行します。
$ python manage.py shell
Python 3.7.1 (default, Oct 22 2018, 10:41:28)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.1.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from django.contrib.auth.models import User
In [2]: for user in User.objects.all():
...: print(user.id,user.username,user.email)
...:
1 admin test@test.com
2 test01
3 test02
4 test03
In [3]: quit
データベースに直接アクセスして確認するとこうなります。
$ python manage.py dbshell
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 63
Server version: 10.5.12-MariaDB-1build1 Ubuntu 21.10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [django]> select id,username,email from auth_user;
+----+----------+---------------+
| id | username | email |
+----+----------+---------------+
| 1 | admin | test@test.com |
| 2 | test01 | |
| 3 | test02 | |
| 4 | test03 | |
+----+----------+---------------+
4 rows in set (0.00 sec)