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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:44:14+00:00 2026-06-16T20:44:14+00:00

I am using Django’s built-in comments app. But I have met one problem. The

  • 0

I am using Django’s built-in comments app. But I have met one problem.

The default label for the comments form is English(e.g. “Name”,”Email Address”), but I’d like to change them into Chinese. So I went to site-packages/django/contrib/comments/forms.py and amend them as below:

name          = forms.CharField(label=_("姓名 Name"), max_length=50)
email         = forms.EmailField(label=_("邮箱 Email"))
url           = forms.URLField(label=_("网站 URL"), required=False)
comment       = forms.CharField(label=_("评论 Comment"), widget=forms.Textarea,
                               max_length=COMMENT_MAX_LENGTH)

But it failed when I runserver again, it says

SyntaxError: Non-ASCII character '\xe5' in file /usr/lib/python2.7/site-packages/django/contrib/comments/forms.py on line 98, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

So I went to http://www.python.org/peps/pep-0263.html and Add “# –– coding: utf-8 –-” in the head of forms.py file. To be joy, I can run the server. But when I went to the comment Page, the comment form disappeared!

Can anybody tell me what’s going on? And how to repair it ?

  • 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-06-16T20:44:15+00:00Added an answer on June 16, 2026 at 8:44 pm

    Django’s comments app is already translated to Chinese, you don’t need to do that yourself.

    You will just need to enable internationalization in your django configuration:

    USE_I18N = True
    
    LANGUAGES = (
      ('zh_CN', 'Chinese'),
    )
    

    You can roll back all the changes you made to the django/contrib/comments/forms.py file.

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

Sidebar

Related Questions

I using Django and a generic view django.views.generic.create_update.create_object I have a model form wich
Using django-contact-form , I have overridden the form class: from contact_form.forms import ContactForm from
Been using Django for < 1yr now, but this one is new-to-me. Hopefully someone?
Am using django forms on my app. I have a model Client like this:
I'm using Django for our project. And I have created a form using Django
Using Django's built in models, how would one create a triple-join between three models.
Using django comments framework http://docs.djangoproject.com/en/dev/ref/contrib/comments/ Not sure is there option, to make all comments
using django 1.4 I have a model with a datetimefield. I imported django.utils.timezone to
Am using django social-auth authentication for my app.After login to facebook or twitter from
I am using django-registration and would like to have a different page for failed

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.