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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:03:18+00:00 2026-05-14T18:03:18+00:00

I have blog comment forms in Django and I would like to know the

  • 0

I have blog comment forms in Django and I would like to know the following:

  1. Should I add CSRF to the forms?
  2. If I want to use the simple “render_comment_form” method, how do I add it?
  3. If I can’t add it like that, what is the best practice for doing it?

Each tutorial or discussion on the subject seems to have a different approach, and I am not certain I understand how it all works.

  • 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-14T18:03:18+00:00Added an answer on May 14, 2026 at 6:03 pm

    My answer assumes that you are using Django 1.2:

    1. Yes! You should protect all your data that is sent by POST requests to the server against CSRF attacks.
    2. You don’t need to add the token yourself. This is already done by django. Have a look at the default template that is used by the render_comment_form tag and you will see, that the csrf_token is already included. You can overwrite this template in your project and including the CSRF token into it is as easy as writing {% csrf_token %} into the form.
    3. There is a way to protect your forms even if you don’t set the tokens in the templates. Have a look at django’s documentation about that topic. But this method is marked as a legacy method so it’s not recommended to use that – it’s only provided for backwards compatibility with versions of Django earlier than 1.2.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Rails 3.2. I have following models: Blog Comment User class Blog
In a blog in Rails I want to have paths like http://mydomain.com/posts/28383/comments#21 This is
I am playing with making a blog. I would like to have several types
I have a django site that's tightly coupled with a wordpress blog. I want
I have a path like: /blog/2/post/45/comment/24 Can I have an array depends on what
Creating a simple blog application, I have this partial .comment %p %b Namn: =
I have to store blog style comments in a database. Each comment can have
I have a confusion, i was going through a blog and in its comment
I'm trying to redirect all requests which have /blog/? to /?... and use the
I have a blog. I like people to login to my website and mark

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.