[Answered ]-How to add two models in one page Django

1👍

render accepts only one context variable. Therefore, you need to pass everything via one variable:

def home(request):
    home_results = MainPageInfo.objects.all();
    navigation_results_hone = Navigation.objects.all();
    context = {'home_results': home_results, 'navigation_results_hone': navigation_results_hone}
    return render(request, 'index.html', context)
👤Marco

Leave a comment