My question is, how do I send two objects to this file?
Well, to send two objects to a template you can pass context
of the function render
Ex:
def foo(request):
object1 = Object1.object.all()
object2 = Object2.object.all()
context = {'object1': object1, 'object2': object2}
return render(request, 'template.html', context)
for these objects to be shown in all other views, which
the extend in this page (base.html)
The variables / objects that you send to the template are only available for the template that was sent.
In order for the variables / objects to be available in the other templates, you must use context processor .
Ex:
views.py
def foo(request):
object1 = Object1.object.all()
object2 = Object2.object.all()
context = {'object1': object1, 'object2': object2}
return context
settings.py
TEMPLATE_CONTEXT_PROCESSORS += ("sua_app.views.foo", )