title: ValueError at /account/register/
body: <p>Can anyone help me figure this out? I keep getting a valueError saying my view isn't returning an HttpResponse! I'm not sure what could be causing the error. I checked my indentations, as well as all of my urls. I'm using the redirect(reverse()) function to call the url in my views. </p>
  
  <p>here's the traceback:
  Internal Server Error: /account/register/</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Library/Python/2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
      response = get_response(request)
    File "/Library/Python/2.7/site-packages/django/core/handlers/base.py", line 198, in _get_response
      "returned None instead." % (callback.__module__, view_name)
  ValueError: The view accounts.views.register didn't return an HttpResponse object. It returned None instead.
  </code></pre>
  
  <p>Here are my accounts/views.py</p>
  
  <pre><code>from django.shortcuts import render, redirect
  from django.urls import reverse
  
  from accounts.forms import (
      RegistrationForm,
      EditProfileForm
  )
  
  from django.contrib.auth.models import User
  from django.contrib.auth.forms import UserChangeForm, PasswordChangeForm
  from django.contrib.auth import update_session_auth_hash
  from django.contrib.auth.decorators import login_required
  
  
  def register(request):
      if request.method =='POST':
          form = RegistrationForm(request.POST)
          if form.is_valid():
              form.save()
              return redirect(reverse('home:home'))
          else:
              form = RegistrationForm()
              args = {'form': form}
          return render(request, 'accounts/reg_form.html', args)
  
  def view_profile(request, pk=None):
      if pk:
          user = User.objects.get(pk=pk)
      else:
          user = request.user
          args = {'user': user}
      return render(request, 'accounts/profile.html', args)
  
  def edit_profile(request):
      if request.method == 'POST':
          form = EditProfileForm(request.POST, instance=request.user)
  
          if form.is_valid():
              form.save()
              return redirect(reverse('accounts:view_profile'))
      else:
          form = EditProfileForm(instance=request.user)
          args = {'form': form}
          return render(request, 'accounts/edit_profile.html', args)
  
  def change_password(request):
      if request.method == 'POST':
          form = PasswordChangeForm(data=request.POST, user=request.user)
  
          if form.is_valid():
              form.save()
              update_session_auth_hash(request, form.user)
              return redirect(reverse('accounts:view_profile'))
          else:
              return redirect(reverse('accounts:change_password'))
      else:
          form = PasswordChangeForm(user=request.user)
  
          args = {'form': form}
          return render(request, 'accounts/change_password.html', args)
  </code></pre>
  
  <p>and here are my accounts/urls.py:</p>
  
  <pre><code>from django.conf.urls import url
  from . import views
  from django.contrib.auth.views import (
      login, logout, password_reset, password_reset_done, password_reset_confirm,
      password_reset_complete
  )
  
  urlpatterns = [
      url(r'^login/$', login, {'template_name': 'accounts/login.html'}, name='login'),
      url(r'^logout/$', logout, {'template_name': 'accounts/logout.html'}, name='logout'),
      url(r'^register/$', views.register, name='register'),
      url(r'^profile/$', views.view_profile, name='view_profile'),
      url(r'^profile/(?P&lt;pk&gt;\d+)/$', views.view_profile, name='view_profile_with_pk'),
      url(r'^profile/edit/$', views.edit_profile, name='edit_profile'),
      url(r'^change-password/$', views.change_password, name='change_password'),
  
      url(r'^reset-password/$', password_reset, {'template_name': 'accounts/reset_password.html', 'post_reset_redirect': 'accounts:password_reset_done', 'email_template_name': 'accounts/reset_password_email.html'}, name='reset_password'),
  
      url(r'^reset-password/done/$', password_reset_done, {'template_name': 'accounts/reset_password_done.html'}, name='password_reset_done'),
  
      url(r'^reset-password/confirm/(?P&lt;uidb64&gt;[0-9A-Za-z]+)-(?P&lt;token&gt;.+)/$', password_reset_confirm, {'template_name': 'accounts/reset_password_confirm.html', 'post_reset_redirect': 'accounts:password_reset_complete'}, name='password_reset_confirm'),
  
      url(r'^reset-password/complete/$', password_reset_complete,{'template_name': 'accounts/reset_password_complete.html'}, name='password_reset_complete')
  
  ]
  </code></pre>