有沒有辦法調用我所有的用戶數據?不使用所有的模板變量在我的意見Django - 在render_to_response中使用我的上下文
模板:
{% csrf_token %}
<h1>Welcome {{user.full_name}} {{user.last_name}}</h1>
<h1>{{user.email}}</h1>
在我的意見
所以我將使用更少的代碼,通過不聲明所有的字典
意見
return render_to_response('user/userhome.html', user)
在這裏找到我的答案http://stackoverflow.com/questions/2246725/django-template-context-processors – BrianCas