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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:31:13+00:00 2026-05-30T17:31:13+00:00

I am trying to set the Django Admin to display English. This is what

  • 0

I am trying to set the Django Admin to display English. This is what I got in the settings file.

gettext = lambda s: s
LANGUAGES = (
    ('zh-tw', gettext('Traditional Chinese'))
)

This is from the example of the Official docs.

However, this is the traceback I’m receiving:

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/admin/

Django Version: 1.3.1
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'myapp']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.middleware.csrf.CsrfResponseMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware')


Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
  89.                     response = middleware_method(request)
File "/Library/Python/2.7/site-packages/django/middleware/locale.py" in process_request
  16.         language = translation.get_language_from_request(request)
File "/Library/Python/2.7/site-packages/django/utils/translation/__init__.py" in get_language_from_request
  124.     return _trans.get_language_from_request(request)
File "/Library/Python/2.7/site-packages/django/utils/translation/trans_real.py" in get_language_from_request
  369.     supported = dict(settings.LANGUAGES)

Exception Type: ValueError at /admin/
Exception Value: dictionary update sequence element #0 has length 5; 2 is required

it seems it is expecting a 2 character string for the first element of the tuple… However in the docs it says to use zh-tw, I’m really at a loss…

  • 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-30T17:31:14+00:00Added an answer on May 30, 2026 at 5:31 pm

    It looks like a missing comma:

    LANGUAGES = (
         ('zh-tw', gettext('Traditional Chinese')), # <= add a comma here
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to set up a proxy model in django admin. It will represent
I am at my wits. I am trying to set up Django admin but
I'm on Mac Leopard. Trying to get django admin file uploads, or really image
I'm trying to get the Django Admin interface to display information about my profile.
I'm just learning Django, and I'm trying to set up the admin area for
I'm trying to set up OpenID authentication in Django, using django-authopenid. The instructions are
I've been trying to get django set up so I can start learning it.
I'm trying to set up the simple syndication example from the Django docs, in
I am going through the Django Book and got really stuck when trying to
I have a Django app I'm trying to set up documentation for. The directory

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.