Trying to get authenticate in loginfunc() to work.

Edited request.POST.get('username') to request.POST.['username'], etc. Does login(request, user) work?