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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:05:58+00:00 2026-05-28T08:05:58+00:00

Trying to do a heroku python manage.py createsuperuser gave me an error that ended

  • 0

Trying to do a heroku python manage.py createsuperuser gave me an error that ended roughly:

File "/usr/local/www/site-python/lib/django-trunk/django/contrib/auth/management/__init__.py", line 85, in get_system_username
 return getpass.getuser().decode(locale.getdefaultlocale()[1])
TypeError: decode() argument 1 must be string, not None

Entering a shell confirmed: locale.getdefaultlocale() is returning (None, None) on my Heroku Cedar stack. How do I set the locale such that python picks it up?

  • 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-28T08:05:59+00:00Added an answer on May 28, 2026 at 8:05 am

    To answer my own question: it turns out this can be fixed by the setting a heroku configuration variable, which results in an environment variable that python can pick up, which returns usable values from locale.getdefaultlocale().

    In my case the heroku setting I used was:

    heroku config:add LANG=en_US.UTF-8
    

    (Of course other encoding and especially language values might make sense for others.)

    It fixed the createsuperuser issue and so far so good on everything else. (Other reports suggest users doing a syncdb and choosing to create a superuser then have also hit this same error on some systems.)

    Note that any such change triggers a restart of your instance(s).

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

Sidebar

Related Questions

Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
I'm trying to migrate my app to Heroku - I have a config file
I am trying to run my app in heroku but I get this error
I am getting the following error while trying to install heroku. arun@laptop:~/apps/pm$ sudo gem
While trying to git push heroku master, I keep getting the error : Counting
I am trying to stage an app on Heroku that uses the Authlogic plugin.
I'm getting this error when trying to start my play app on Heroku: heroku[web.1]:
I'm trying Heroku with Python, I ran the hello word example with Flask successfully.
I am trying to use heroku and appear to be getting a Postgres error
I'm trying to launch a heroku console that uses rubygems but I keep getting

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.