H
H
howuu2019-03-06 02:16:47
PostgreSQL
howuu, 2019-03-06 02:16:47

Issues with createsuperuser on Postgresql?

I'm trying to set up a vps server under Django, the following has become another pitfall.
I downloaded my app using gitclone,
connected it in settings and urls
did the migration
checked it - it started via manage.py runserver
I thought to create a superuser and here

(hello_django) [email protected]:/webapps/hello_django/hello# python3 manage.py createsuperuser
Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.6/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 59, in execute
    return super().execute(*args, **options)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.6/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 112, in handle
    username = self.get_input_data(self.username_field, input_msg, default_username)
  File "/usr/local/lib/python3.6/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 193, in get_input_data
    raw_value = input(message)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

What is happening and how to solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
howuu, 2019-03-06
@howuu

I solved this problem with

export PYTHONIOENCODING="UTF-8"; python3.6 manage.py createsuperuser

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question