title: I can't register user in my user registration form
body: <p>I have created a user registration form, every thing looks fine but when I try to register new user it brings back the same form while I redirected it to home page. Also when I go to admin to look for new registered user, I see nothing</p>
  
  <p>This is for python 3.7.3, django 2.2.3 and mysql 5.7.26. I have tried to check and recheck every thing seems to be ok but still I can't achieve what I want</p>
  
  <p>forms.py </p>
  
  <pre><code>class NewUserForm(UserCreationForm):
  email = forms.EmailField(required=True)
  
  class Meta:
      model = User 
      fields = ("username","email","password1","password2")
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def register(request):
  if request.method == "POST":
      user_form = UserCreationForm(request.POST)
      if user_form.is_valid():
          user = user_form.save()
          username = user_form.cleaned_data.get("username")
          raw_password = user_form.cleaned_data.get("password1")
          user = authenticate(username=username, password=raw_password)
  
          login(request, user)
          return redirect("loststuffapp:IndexView")
      else:
          for msg in user_form.error_messages:
              print(user_form.error_messages[msg])
  else:
      user_form = UserCreationForm
  return render(
                  request,
                  "loststuffapp/register.html",
                  context={"user_form":user_form}
  
      )
  </code></pre>
  
  <p>register.html</p>
  
  <pre><code>{% extends "loststuffapp/base.html" %}
  
  {% block content %}
     &lt;form method="POST"&gt;
        {% csrf_token %}
        {{user_form.as_p}}
         &lt;button type="submit" style="background-color: 
        yellow"&gt;Register&lt;/button&gt;&gt;
        If you already have an account, &lt;a href="/Register"&gt;login&lt;/a&gt; instead
     {% endblock %}
  </code></pre>