To answer my own question: it turns out, this can be fixed by setting the heroku configuration variable, which leads to an environment variable that python can select, which returns useful values ββfrom locale.getdefaultlocale ().
In my case, the heroku parameter that I used was:
heroku config:add LANG=en_US.UTF-8
(Of course, other encodings and especially linguistic values ββmay make sense to others.)
The createuperuser problem is fixed and is still so good in everything else. (Other reports show that users running syncdb and choosing to create a superuser then also fall into the same error on some systems.)
Note that any such change triggers a restart of your instance.
source share