4👍
✅
url(r'^login/$', auth_views.login, {'extra_context':{'all_user':User.objects.all()}}, name='login'),
use like this
0👍
You must have get all user in views on django like
views.py
class GetUser():
def get_context_data():
all_user = ....(get data from api for model database)
context = {(
'all_user': all_user,
)}
return context
html will be
{% for user in all_user %}
<option>{{ user.first_name }}</option>
{% endfor %}
- [Django]-Django FilteredSelectMultiple not rendering on page
- [Django]-How to make permission for groups and administrators
- [Django]-Optimizing setup and teardown for sample django model using django_nose and django-dynamic-fixture
- [Django]-Gunicorn Django Threading
Source:stackexchange.com