im using the comment system, now, i would like to re-write the segment form the url comment and append a symbol #, i want to move the page seccion to the comment list exactly to the last comment user with <a name=#{{comment.id}}?> username </a>
Im using next for redirect the usen when the comment was posted:
{% get_comment_form for object as form %}
<form action="{% comment_form_target %}" method="POST">
{{ form }}
<input type="hidden" name="next" value="{{ object.get_absolute_url }}" />
<input type="submit" name="preview" class="submit-post" value="Preview"></td>
</form>
But in the Django Doc dont say nothing about rewrite or customizer the comment redirect / url
Any idea?
Thanks
I just stumbled across this little bit of ugliness. After reading the source code I didn’t see any nice way to override this behavior. By default you are redirected to the URL in the template’s
{{ next }}variable and Django appends a?c=1to the URL where the1is the ID of the comment. I wanted this to instead be#c1so the user is jumped down the page to the comment they just posted. I did this with a little bit of “monkey patching” as follows: