title: Django error: didn't return an HttpResponse object. It returned None instead
body: <p>I have the following form:</p>
  
  <pre><code>class PrestataireProfilForm(forms.ModelForm):
      class Meta:
          model = Prestataire
          fields = ["user", "name", "address", "phone", "fax", "city"]
  
      def __init__(self, *args, **kwargs):
          super(PrestataireProfilForm, self).__init__(*args, **kwargs)
          self.fields['city'].widget.attrs.update({'class' : 'custom-select'})
          self.fields['city'].label = ""
  </code></pre>
  
  <p>And this is my view:</p>
  
  <pre><code>@login_required
  def prestataire_profil(request):
      prestataire = Prestataire.objects.filter(user=request.user).first()
      is_prestataire = request.user.groups.filter(name='Prestataire').exists()
      form = PrestataireProfilForm(request.POST or None, instance=prestataire)
      if request.method == 'POST':
          context = {
              'profil': prestataire,
              'is_prestataire': is_prestataire,
              'form': form
          }
          if form.is_valid():
              prestataire = form.save(commit=False)
              prestataire.save()
              context = {
              'profil': prestataire,
              'is_prestataire': is_prestataire
              }
              # return render(request, 'dashboard/prestataires/profil.html', context)
              return redirect('prestataire_profil')
      else:
          context = {
              'profil': prestataire,
              'is_prestataire': is_prestataire,
              'form': form
          }
          return render(request, 'dashboard/prestataires/profil.html', context)
  </code></pre>
  
  <p>And this is my html form:</p>
  
  <pre><code>&lt;form method='POST'&gt;
                  {% csrf_token %}
                  &lt;div class="form-group row"&gt;
                    &lt;label for="name" class="col-4 col-form-label"&gt;Nom d'utilisateur&lt;/label&gt; 
                    &lt;div class="col-8"&gt;
                      &lt;input value="{{ profil.user.username }}" id="name" name="name" placeholder="Nom d'utilisateur" class="form-control here" required="required" type="text" disabled&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group row"&gt;
                    &lt;label for="name" class="col-4 col-form-label"&gt;Nom*&lt;/label&gt; 
                    &lt;div class="col-8"&gt;
                      &lt;input value="{{ profil.user.last_name }}" id="name" name="name" placeholder="Nom" class="form-control here" required="required" type="text"&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group row"&gt;
                    &lt;label for="name" class="col-4 col-form-label"&gt;Prénom*&lt;/label&gt; 
                    &lt;div class="col-8"&gt;
                      &lt;input value="{{ profil.user.first_name }}" id="name" name="name" placeholder="Prénom" class="form-control here" required="required" type="text"&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group row"&gt;
                    &lt;label for="name" class="col-4 col-form-label"&gt;Raison sociale*&lt;/label&gt; 
                    &lt;div class="col-8"&gt;
                      &lt;input value="{{ profil.name }}" id="name" name="name" placeholder="Raison sociale" class="form-control here" required="required" type="text"&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group row"&gt;
                    &lt;label for="address" class="col-4 col-form-label"&gt;Adresse&lt;/label&gt; 
                    &lt;div class="col-8"&gt;
                      &lt;input value="{{ profil.address }}" id="address" name="address" placeholder="Adresse" class="form-control here" type="text"&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group row mb-0"&gt;
                    &lt;label for="address" class="col-4 col-form-label"&gt;Ville&lt;/label&gt; 
                    &lt;div class="col-8"&gt;
                      {{ form.city|as_crispy_field }}
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group row"&gt;
                    &lt;label for="phone" class="col-4 col-form-label"&gt;Téléphone&lt;/label&gt; 
                    &lt;div class="col-8"&gt;
                      &lt;input id="phone" name="phone" placeholder="Téléphone" class="form-control here" type="text"&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group row"&gt;
                    &lt;label for="fax" class="col-4 col-form-label"&gt;Fax&lt;/label&gt; 
                    &lt;div class="col-8"&gt;
                      &lt;input value="" id="fax" name="fax" placeholder="Fax" class="form-control here" type="text"&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group row"&gt;
                    &lt;div class="offset-4 col-8"&gt;
                      &lt;button name="submit" type="submit" class="btn btn-primary"&gt;Update My Profile&lt;/button&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                &lt;/form&gt;
  </code></pre>
  
  <p>When I click on the submit button, it gives me the following error:</p>
  
  <p>Exception Type:     ValueError
  Exception Value:    The view dashboard.views.prestataire_profil didn't return an HttpResponse object. It returned None instead.</p>
  
  <p>The data does not change, and there is no information whatsoever on the debug to see what went wrong. As you can notice in the view, I commented the return render line. I changed it to the return redirect, but same issues!
  Please help! Thank you.</p>