当我尝试运行python manage.py makemigrations
,python 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'