title: How to solve the did not return httpresonse error with django?
body: <p>I have a problem in registration with django, here is my views code:</p>
  
  <pre><code>def register(request):
      if request.method == 'POST':
          form = RegistrationForm(request.POST)
          if form.is_valid():
              form.save()
              return redirect('/')
      else:
          form = RegistrationForm()
  
          args = {'form': form}
          return render(request, 'users/reg_form.html', args)
  </code></pre>
  
  <p>,but i always get: </p>
  
  <blockquote>
    <p>ValueError at /user/register/ The view Users.views.register didn't
    return an HttpResponse object. It returned None instead. Request
    Method:   POST Request URL:   <a href="http://127.0.0.1:3001/user/register/" rel="nofollow noreferrer">http://127.0.0.1:3001/user/register/</a> Django
    Version:  2.0.2 Exception Type:   ValueError Exception Value:  The view
    Users.views.register didn't return an HttpResponse object. It returned
    None instead. Exception
    Location: /home/iah/.local/lib/python3.5/site-packages/django/core/handlers/base.py
    in _get_response, line 139</p>
  </blockquote>