Following works fine in shell:
>>> from django.contrib.auth.models import User >>> user=User.objects.get(pk=1) >>> user.first_name = u
if request.method == "POST": kwargs = { 'data' : request.POST } try: kwargs['instance'] = User.objects.get(username=request.POST['username']) except: pass form = UserForm(kwargs**) if form.is_valid(): user = form.save(commit=False) ...