如何将我在一个视图中创建的上下文数据(inthis case profile_total变量)传递到另一个应用程序的html模板?
这是我的代码:
附件一。意见。py
def view_profile(request):
profile_total = UserProfile.objects.all().count()
return render(request, 'profile/user_profile.html', {'profile_total': profile_total})
附件2。统计数据。html
<div class="container">
<h1> Show </h1>
Profile submitted: {{ profile_total }}
</div>
现在只显示了一个空白区域,而不是提交的个人资料的计数。谢谢大家的帮助!