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?
url(r'^login/$', auth_views.login, {'extra_context':{'all_user':User.objects.all()}}, name='login'),
use like this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With