Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7400509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:15:38+00:00 2026-05-29T04:15:38+00:00

The django contrib comments form i’m using: {% get_comment_form for post as form %}

  • 0

The django contrib comments form i’m using:

{% get_comment_form for post as form %}
<form action="{% comment_form_target %}" method="post">{% csrf_token %}
    {% if next %}
        <div><input type="hidden" name="next" value="{{ next }}" /></div>
    {% endif %}
    {% for field in form %}
        {% if field.is_hidden %}
            <div>{{ field }}</div>
        {% else %}
            {% if field.name == 'comment' %}
            {% if field.errors %}{{ field.errors }}{% endif %}
            <p
                {% if field.errors %} class="error"{% endif %}
                {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %}>
                {{ field.label_tag }} {{ field }}
            </p>
            {% endif %}             
        {% endif %}
    {% endfor %}
    <p class="submit">
        <input type="submit" name="post" class="submit-post" value="{% trans "Post" %}" />
    </p>
</form>

After submitting the form, it redirects to http://127.0.0.1:8000/comments/posted/?c=..

That means it calls the template django/contrib/comments/templates/comments/posted.html

The content of django/contrib/comments/templates/comments/posted.html:

{% extends "comments/base.html" %}
{% load i18n %}

{% block title %}{% trans "Thanks for commenting" %}.{% endblock %}

{% block content %}
<h1>{% trans "Thank you for your comment" %}.</h1>
{% endblock %}

That doesn’t extends my project’s base.html.

I need to customize/override that template so that it extends my project’s base.html. How can i do that?

If i can’t do that, then if i upload my django web project on server, then how would i edit the content of django/contrib/comments/templates/comments/posted.html so that it looks like that:

{% extends "path/to/myproject/templates/base.html" %}
{% load i18n %}

{% block title %}{% trans "Thanks for commenting" %}.{% endblock %}

{% block content %}
<h1>{% trans "Thank you for your comment" %}.</h1>
{% endblock %}

On local pc, for this time i changed/edited the content of django/contrib/comments/templates/comments/posted.html hard-coded to extends my project base.html.

Can anyone give some idea to solve this? I have searched a lot to solve this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:15:39+00:00Added an answer on May 29, 2026 at 4:15 am

    Just override it in your project’s “templates” directory:

    <project_root>/templates/comments/posted.html
    

    It doesn’t seem to be well documented in either the comments app or Django’s general template documentation, but it works the same as overriding admin templates (which is documented).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using django comments framework http://docs.djangoproject.com/en/dev/ref/contrib/comments/ Not sure is there option, to make all comments
This is the form file of django.contrib.comments.forms: https://github.com/django/django/blob/master/django/contrib/comments/forms.py I need to create an object
When using django.contrib.comments is there anyway to add the reverse relationship to a model
I'm using django-profiles and django.contrib.comments and I am trying to display all comments for
I am using the delete() function from django.contrib.comments.views.moderation module. The staff-member is allowed to
So I am using Djangos builtin comments app (django.contrib.comments) for my blog application. I
I'm using django.contrib.comments for enabling comments on a blog. I was adding a hidden
I'm using django.contrib.comments for allowing users to comment on a blog. How is it
I want to use django.contrib.comments in a blogging application and customize the way the
I'm using the django-contrib package django-profiles , and everything is working great - my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.