title: ValueError: The view accounts.views.register didn't return an HttpResponse object. It returned None instead
body: <p>I am getting this error and I have not been able to fix this.
  Here are the files:views.py</p>
  
  <pre><code>from django.shortcuts import render,HttpResponse
  from django.contrib.auth.forms import UserCreationForm
  # Create your views here.
  def home(request):
      numbers=[1,2,3,4,5]
      name='satya'
      args={'MYname':name,'numbers':numbers}
      return render(request,'accounts/home.html',args)
  
  def register(request):
      if request.method=='POST':
          form=UserCreationForm(request.POST)
          if form.is_valid():
              form.save()
              return HttpResponseRedirect('/accounts')
  
      else:
          form=UserCreationForm()
          args={'form':form}
          return render(request,'accounts/reg_form.html',args)    
  </code></pre>
  
  <p>Here is reg_form.html</p>
  
  <pre><code>{% extends 'base.html' %}
  
  {% block body %}
  &lt;div class="container"&gt;
      &lt;h1&gt; Register &lt;/h1&gt;
      &lt;form method="post"&gt;
      {% csrf_token %}
      {{form.as_p}}
      &lt;&lt;button type=" submit " class="submit" &gt;Submit&lt;/button&gt;
  
  
  &lt;/form&gt;
  &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>I have imported the things correctly but not getting as what is wrong.</p>