Django Get All Users

前端 未结 4 683
执念已碎
执念已碎 2020-12-24 01:08

I am just starting out with Django and I am messing around just trying to pull a full list of users from postgres.

I used the following code:

group =         


        
4条回答
  •  无人及你
    2020-12-24 01:57

    from django.contrib.auth import get_user_model
    User = get_user_model()
    users = User.objects.all()
    

提交回复
热议问题