i want to pass 2 lists to django template but only first is rendered this is index.html:
enter code here {% if latest_poll_list %} <ul> {% for poll in latest_poll_list %} <li>{{ poll.question }}</li> {% endfor %} </ul> {% else %} <p>No polls are available.</p> {% endif %} {% if menu_items_list %} <table id="menu_items_list"> <tr> {% for item_url, item_name in menu_items_list %} <td><a href="item_url">item_name</a> {% endfor %} </tr> </table> {% endif %} <h3>{{ index_name }}</h3> and this is urlconf:
urlpatterns = patterns('zzz.polls.views', url(r'^$', ListView.as_view( queryset=Poll.objects.order_by('pub_date')[:5], context_object_name='latest_poll_list', template_name='index.html')), and views:
def index(request): latest_poll_list = Poll.objects.all().order_by('pub_date')[:5] index_name = 'INDEX PAGE' menu_items_list = ['somesite.com', 'Googy') for x in xrange(5)] return render_to_response('index.html', {'latest_poll_list': latest_poll_list, 'menu_items_list' : menu_items_list, 'index_name': index_name}) where i make mistake??