Django template tag on built-in login User.objects.all()

Viewed 712

I am using built-in login of django. How I can display all the first name of the registered user on its template using tags?

There's no function to add a context because it is built-in so this is what I added to my urls.py, the kwargs thing what I read to other post.

from django.contrib.auth.models import User

url(r'^login/$', auth_views.login, name='login', kwargs={'all_user': User.objects.all()}),

my template at registration/login.html as default

{% for user in all_user %}
    <option>{{ user.first_name }}</option>
{% endfor %}

When I am accessing now the login it returns an error:

LoginView() received an invalid keyword 'all_user'. as_view only accepts arguments that are already attributes of the class.

Is there a way that I can put the context on built-in login?

2 Answers
Related