The django books gives the local trick in order to avoid to type a long list of parameters as context dictionnary
http://www.djangobook.com/en/2.0/chapter04/
I know this is an old thread...currently render_to_response is deprecated. Use render instead without locals(). Passing around all locals is a bad practice. Here is an views.py example:
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
@login_required
def mybooks(request):
entries = Book.objects.all()
return render(request, 'mybooks.html', {'entries': entries})
I don't like it, personally. There's probably no reason for my preference, other than the old Python dictum "Explicit is better than implicit". I like to know exactly what's going into my templates.