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 969139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:35:51+00:00 2026-05-16T02:35:51+00:00

I’ve been reading on the django docs about the comments framework and how to

  • 0

I’ve been reading on the django docs about the comments framework and how to customize it (http://docs.djangoproject.com/en/1.1/ref/contrib/comments/custom/)
In that page, it shows how to add new fields to a form. But what I want to do is to remove unnecesary fields, like URL, email (amongst other minor mods.)

On that same doc page it says the way to go is to extend my custom comments class from BaseCommentAbstractModel, but that’s pretty much it, I’ve come so far and now I’m at a loss. I couldn’t find anything on this specific aspect.

  • 1 1 Answer
  • 1 View
  • 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-16T02:35:51+00:00Added an answer on May 16, 2026 at 2:35 am

    I recently implemented the solution that Ofri mentioned, since I only wanted to accept a solitary “comment” field for a comment (like SO does, no “name”, no “email” and no “url”).

    To customize the default comment form and list display, I created a “comments” directory in my root “templates” directory and overrode the two default comment templates.

    My “/templates/comments/form.html” is:

    {% load comments i18n %}
    {% if user.is_authenticated %}
        <form action="{% comment_form_target %}" method="post">
            {% csrf_token %}
            {% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
            {% for field in form %}
                {% if field.is_hidden %}
                    {{ field }}
                {% else %}
                    {% if field.name != "name" and field.name != "email" and field.name != "url" %}
                        {% if field.errors %}{{ field.errors }}{% endif %}
                        <p {% if field.errors %} class="error"{% endif %} {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %}>
                        {{ field }}
                        </p>
                    {% endif %}
                {% endif %}
            {% endfor %}
            <input type="submit" name="post" class="submit-post" value="{% trans "Add Comment" %}" />
        </form>
    {% else %}
        I'm sorry, but you must be <a href="javascript:alert('send to login page')">logged in</a> to submit comments.
    {% endif %}
    

    Which is only slightly different from the default comments form, primarily suppressing the display of the not-required “name”, “email” and “url” inputs.

    My “/templates/comments/list.html” is:

    <div class="comment_start"></div>
    {% for comment in comment_list %}
        <div class="comment">
           {{ comment.comment }} 
           (from <a href="javascript:alert('show user profile/stats')">{{ comment.user }}</a> - {{ comment.submit_date|timesince }} ago)
        </div>
    {% endfor %}
    

    On the page I want the form, I first call {% load comments %} and then {% render_comment_form for [object] %} to show the form, or {% render_comment_list for [object] %} to generate a list of the comments on the object (replace [object] with your appropriate object name).

    This is working great for me, and still giving me all the other “free” stuff that comes with django comments (moderation, flagging, feeds, polymorphic associations, etc…)

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.