cannot resolve keyword 'user' into field. choices are : **I am trying to edit data of model UserProfile.
Here is code for same.**
#form.py
class UserprofileForm(forms.ModelForm):
	class Meta:
		model = UserProfile
		fields = ['profile_photo', 'gender', 'contact_number', 'age', 'address']
#view.py
def edit_user(request):
	if not request.user.is_authenticated():
		return render(request, 'service/login.html')
	else:
		userdata = UserProfile.objects.all().filter(user = request.user)
		userd = UserProfile.objects.get(user2 = request.user.pk)
		form = UserprofileForm(request.POST or None, instance = user2)
		if form.is_valid():
			user1 = form.save(commit = False)
			user1.user = request.user
			user1.save()
			return render(request,'service/user.html', {'userdata' : userdata,})
