E
E
Evgeny Zubkov2021-07-28 16:33:40
Django
Evgeny Zubkov, 2021-07-28 16:33:40

How to get a list of registered users in Django?

Good afternoon. Can you please tell me how to get a list of registered users in Django? I tried the method described here , but got an error:
relation "blog_userprofile" does not exist
LINE 1: ...rprofile"."id", "blog_userprofile"."user_id" FROM "blog_user...
^
Request Method: GET
Request URL : 127.0.0.1:8000/admin_sees_everything
Django Version: 3.2.5
Exception Type: ProgrammingError
Exception Value:
relation "blog_userprofile" does not exist
LINE 1: ...rprofile"."id", "blog_userprofile"."user_id" FROM " blog_user...
Exception Location: /home/yakamoz/.virtualenvs/blog-9i5ib5Bf/lib/python3.8/site-packages/django/db/backends/utils.py, line 84, in _execute
Python Executable: /home/yakamoz/.virtualenvs /blog-9i5ib5Bf/bin/python
Python Version: 3.8.10
Python Path:
['/home/yakamoz/blog',
'/usr/lib/python38.zip',
'/usr/lib/python3.8',
' /usr/lib/python3.8/lib-dynload',
'/home/yakamoz/.virtualenvs/blog-9i5ib5Bf/lib/python3.8/site-packages']
Server time: Wed, 28 Jul 2021 13:31: 10 +0000

How can I get a list of registered users, so that I can display them on the page later? I'm going to enter it like this:

{% block content %}
  {% for user in users_list %}
  <div class="post-entry">
    <p>{{ user.user }}</p>
  </div>
  {% endfor %}
{% endblock content %}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2021-07-28
@Yakamoz

So it's written after all: What does the view and extended user model look like?
relation "blog_userprofile" does not exist

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question