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


i using built-in login of django. how can display first name of registered user on template using tags?

there's no function add context because built-in added urls.py, kwargs thing read 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 @ registration/login.html default

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

when accessing login returns error:

loginview() received invalid keyword 'all_user'. as_view accepts arguments attributes of class.

is there way can put context on built-in login?

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

use this


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

Ruby Google Calendar Integration Watch Event / Push Notification -