You must use request.POST.get()
for getting the attributes that are send by the url, and send to the
f = User(request.POST)
the attributes for the model like u = User(name=name, subject=subject)
#views.py
def add_user(request):
if request.method == 'POST':
name = request.POST.get('name', '')
subject = request.POST.get('subject', '')
u = User(name=name, subject=subject)
u.save()
return render(request, 'index.html')
return render(request, 'index.html')
On the template you´re missing the name of the input tag, without it nothing is send.
#index.html
<!DOCTYPE html>
<html>
<head>
<title>Sistemas Web</title>
</head>
<body>
<div>
<h1>Add User</h1>
<form action="add_user" method="POST">{% csrf_token %}
<label>Name</label><br>
<input name="name" type="text"><br>
<input type="radio" name="subject" value="A">A<br>
<input type="radio" name="subject" value="B">B<br>
<input type="submit" value="Enviar">
</form>
</div>
</body>
</html>
Hope it helps