title: Django : How can I use the response returned by form_valid() of a CreateView on another model in a new template?
body: <p>I am learning Django, and I am sure the solution is very simple but I can't find it; 
  I have a model "profile" that needs to be filtered by a request. Requests and answers need to be kept in database. But I don't want the user to see all the profiles at any moment.<br>
  So I wrote two models : the first one contains the requests (MyRequest), the second the potential answers (Profile). Profiles are created importing csv in Django admin.
  I wrote a code that is working fine BUT I can't figure out how to send my response in a template to use all the customizations and securities as csrf_token.</p>
  
  <p>Currently it is showing the response in the same url than the request and I am blocked there</p>
  
  <p>I have tried to use get_succes_url with HttpResponseRedirect, usually I can do such things using (?P\d+)/$' in the success url but it doesn't work maybe because the two models don't share any key? 
  I have tried to put  and  in success url but I think I did something wrong</p>
  
  <pre><code>"""Models"""
  class Profile(models.Model):#probgerme probpvt probservice probATCDpvt probATCDbmr probNB
      profname= models.CharField(max_length=20)
      bq = models.ForeignKey(Bq, on_delete=models.CASCADE)#, blank=True
      test1 = models.CharField(max_length=100)
      test2 = models.CharField(max_length=100)
      test3 = models.CharField(max_length=100)
  
  class MyRequest(models.Model):#probgerme probpvt probservice probATCDpvt probATCDbmr probNB
      reqname = models.CharField(max_length=20)
      bq = models.ForeignKey(Bq, on_delete=models.CASCADE)
      user = models.ForeignKey(settings.AUTH_USER_MODEL,default=0, related_name="user2")
      test1 = models.CharField(max_length=100)
      test2 = models.CharField(max_length=100)
  
  """Forms"""
  class MyRequestCreateForm(forms.models.ModelForm):
      class Meta:
          model = MyRequest
          fields = ('bq','test1','test2')
      def save(self, *args, **kwargs):       
          myrequest = super().save(*args, **kwargs)
          myrequest.save()
  
  """URL """
  url(r'^essai_create/$', views.MyRequestCreateView.as_view(), name='my_request'),
  
  
  """Views"""
  class MyRequestCreateView(LoginRequiredMixin, generic.CreateView): 
      form_class = MyRequestCreateForm
      model = MyRequest
      def get_queryset(self):      
          queryset = super().get_queryset().filter(user=self.request.user)
          return queryset
  
      def get_form(self, form_class=None):
         form = super().get_form(form_class)
          form.fields['test1'].required = True 
          return form
  
      def form_valid(self, form):
          form.instance.user = self.request.user 
          self.object = form.save()
          data = form.cleaned_data
          test1 = data['test1']
          test2 = data['test2']
  
          print('data',data)
          try:
              Profile.objects.get(test1 = test1, test2 = test2 )
              tested3= Profile.objects.get(test1 = test1, test2 = test2).test3.split(',')
  
          except ObjectDoesNotExist:
              tested3 = ['nothing']*5           
  
          reponse = "Votre requête : test1 = " + test1 + ", test2 = " + test2 +    "&lt;br&gt;val1, "+tested3[0] + "&lt;br&gt;val2, "+tested3[1] + "&lt;br&gt;val3 " + tested3[2]+ "&lt;br&gt;val4, " + tested3[3]
          return HttpResponse(reponse)
  
  """Template myrequest_form.html"""
  
  {% extends 'base2.html' %}
  {% load bootstrap %}
  {% load crispy_forms_tags %}
  {% load static %}
  {% block content %}
  
  &lt;div class="container "&gt;
    &lt;form method="POST" enctype="multipart/form-data" id="project-form"&gt;
      {% csrf_token %}
  
  
      &lt;form method="post" &gt;
      {% csrf_token %}
      {{ form.bq|as_crispy_field }}
      &lt;br&gt;
        &lt;div class="col-6"&gt;
          Information sur le test1 {{ form.test1 }} &lt;br&gt;
        &lt;/div&gt;
          &lt;br&gt;
        &lt;div class="col-6"&gt;
          Information sur le test2 {{ form.test2 }}&lt;br&gt;
        &lt;/div&gt;
          &lt;br&gt;
  
  &lt;br&gt;&lt;br&gt;
           &lt;button id = "submitRequest" aria-pressed="true" class="btn btn-primary active" onclick="showPleaseWait()"  type="submit"   &gt;Check for best answer&lt;/button&gt;
    &lt;/form&gt;
  
  
    &lt;/form&gt;
  &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>Currently after clicking "Check for best answer" button in the template opened in <a href="http://localhost:8000/myapp/essai_create/" rel="nofollow noreferrer">http://localhost:8000/myapp/essai_create/</a>, this same url
  <a href="http://localhost:8000/myapp/essai_create/" rel="nofollow noreferrer">http://localhost:8000/myapp/essai_create/</a>
  shows:
  <br>
  Votre requête : test1 = nouveau, test2 = Rouge
  <br>
  val 1, 7
  <br>
  val 2, 12
  <br>
  val 3, 4
  <br>
  val 4, 5</p>