提问者:小点点

如何在Python中返回两个字典?


如何在Python中返回两个骰子?

下面是我的视图。py

def index(request):
    dests = photo.objects.all()
    return render(request, "index.html", {'dests':dests})


def gallery(request):
   gals = wedding.objects.all()
   return render(request, "gallery.html", 'gals':gals) 

共1个答案

匿名用户

正如我所理解的,您可以定义一个新函数并使用之前定义的两个函数。

def newFunction(request):
 return index(request),gallery(request)