title: Django: How to define "Next" within the Comments form
body: <p>I am using the Django comments framework in two places on my site. After each submission, I'd like for the user to just be redirected back to the original page they were on.</p>
  
  <p>How do you define the "next" variable so the user is redirected?</p>
  
  <p>Information on the redirect : <a href="http://docs.djangoproject.com/en/dev/ref/contrib/comments/#redirecting-after-the-comment-post" rel="nofollow">http://docs.djangoproject.com/en/dev/ref/contrib/comments/#redirecting-after-the-comment-post</a></p>
  
  <p>Also, here is the form I am using. The comment.types do not work, but that is what I think I am supposed to do - define two different next inputs for each comment type (picture vs meal).</p>
  
  <pre><code>{% load comments i18n %}
  &lt;form action="{% comment_form_target %}" method="post"&gt;{% csrf_token %}
      {% if comment.type == '19' %}
      &lt;input type="hidden" name="next" value="{% url meal comment.object_pk %}" /&gt;
      {% endif %}
      {% if comment.type == '23' %}
      &lt;input type="hidden" name="next" value="{% url picture comment.object_pk %}" /&gt;
      {% endif %}
    &lt;!-- &lt;input type="hidden" name="next" value="{{ next }}" /&gt; --&gt;
    {% for field in form %}
      {% if field.is_hidden %}
        {{ field }}
      {% else %}
        {% if field.errors %}{{ field.errors }}{% endif %}
        &lt;p
          {% if field.errors %} class="error"{% endif %}
          {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %}
           {% ifequal field.name "name" %} style="display:none;"{% endifequal %}
           {% ifequal field.name "email" %} style="display:none;"{% endifequal %}
           {% ifequal field.name "url" %} style="display:none;"{% endifequal %}
           {% ifequal field.name "title" %} style="display:none;"{% endifequal %}&gt;
          &lt;!-- {{ field.label_tag }}  --&gt;{{ field }}
        &lt;/p&gt;
      {% endif %}
    {% endfor %}
    &lt;p class="submit"&gt;
          &lt;button type="submit"&gt;Send&lt;/button&gt;
      &lt;!-- &lt;input type="submit" name="preview" class="submit-preview" value="{% trans "Preview" %}" /&gt; --&gt;
    &lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And then on the Meal &amp; Picture pages I have:</p>
  
  <pre><code>    &lt;h4&gt;Post a Message&lt;/h4&gt;
  {% render_comment_form for meal %}
  </code></pre>
  
  <hr>
  
  <pre><code>    &lt;h4&gt;Post a Message&lt;/h4&gt;
  {% render_comment_form for picture %}
  </code></pre>