0

I have an existing project that has no views.py and models.py.It has a user login system.I want to get the list of all user in the template.I have searched more but found no solution.

1 Answers1

0

If you for some reason don't want views.py, you can create custom template tag:

@register.simple_tag
def user_list():
    return '<br>'.join([str(u) for u in get_user_model().objects.all()])
rubick
  • 508
  • 1
  • 5
  • 13