title: Assign variables to child template in {% include %} tag Django
body: <p>I have this code(which doesn't give me expected result)</p>
  
  <pre><code>#subject_content.html
  {% block main-menu %}
      {% include "subject_base.html" %}
  {% endblock %}
  
  
  #subject_base.html
  ....
  ....
      &lt;div id="homework" class="tab-section"&gt;
          &lt;h2&gt;Homework&lt;/h2&gt;
              {% include "subject_file_upload.html" %}
      &lt;/div&gt;
  </code></pre>
  
  <p>child template:</p>
  
  <pre><code>#subject_file_upload.html
      &lt;form action="." method="post" enctype="multipart/form-data"&gt;{% csrf_token %}
          {{ form.as_p }}
          &lt;input type="submit" value="submit"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>and my view</p>
  
  <pre><code>#views.py
  @login_required
  def subject(request,username, subject):
      if request.method == "POST":
          form = CarsForm(request.POST, request.FILES)
          if form.is_valid():
              form.save()
              return HttpResponseRedirect("/")
      form = CarsForm()
      return render_to_response('subject_content.html', {'form':form}, context_instance=RequestContext(request))
  </code></pre>
  
  <p>The above code creates HTML in the way I want it to be, however the form does not update database.</p>
  
  <p>BUT,</p>
  
  <p>If I skip the middle template and go directly to the uploading form, it works fine:</p>
  
  <pre><code>#subject_content.html
  {% block main-menu %}
      {% include "subject_file_upload.html" %}
  {% endblock %}
  </code></pre>
  
  <p>Help me please to make it work with middle template. 
  I want to do this, because I don't wan't to type the same code more than once. </p>