python - 尝试迁移时的Django AttributeError

时间:2016-10-26 05:06:02

标签: python django python-3.x

当我尝试运行python manage.py makemigrationspython manage.py migrate甚至python manage.py createsuperuse时,我发现错误AttributeError: '_io.BufferedWriter' object has no attribute 'encoding'。我认为这是manage.py脚本的问题,因为我尝试使用不同的数据库进行迁移,每次遇到同样的问题。

回溯:

Traceback (most recent call last):
File "webapp\manage.py", line 10, in <modu
  execute_from_command_line(sys.argv)
File "\AppData\Local\Programs\Python\Python35\lib\site-packages
  utility.execute()
File "\AppData\Local\Programs\Python\Python35\lib\site-packages
  self.fetch_command(subcommand).run_from_argv(self.argv)
File "\AppData\Local\Programs\Python\Python35\lib\site-packages
  self.execute(*args, **cmd_options)
File "\AppData\Local\Programs\Python\Python35\lib\site-packages
  return super(Command, self).execute(*args, **options)
File "\AppData\Local\Programs\Python\Python35\lib\site-packages
  output = self.handle(*args, **options)
File "\AppData\Local\Programs\Python\Python35\lib\site-packages
  username = self.get_input_data(self.username_field, input_msg, default_usern
File "\AppData\Local\Programs\Python\Python35\lib\site-packages
  raw_value = input(message)
File "\AppData\Local\Programs\Python\Python35\lib\codecs.py", l
  return getattr(self.stream, name)
AttributeError: '_io.BufferedWriter' object has no attribute 'encoding'

0 个答案:

没有答案