我刚刚安装了python 2.7.13和Django 1.11.4。 我创建了一个名为myproject的项目,并尝试从下面的命令开始,但它引发了UnicodeDecodeError错误。UnicodeDecodeError序号不在范围内(128)
python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x7f13229f10c8>
Traceback (most recent call last):
File "/opt/IBM/Python2.6/lib/python2.7/site-packages/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/opt/IBM/Python2.6/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 128, in inner_run
self.check_migrations()
File "/opt/IBM/Python2.6/lib/python2.7/site-packages/django/core/management/base.py", line 422, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/opt/IBM/Python2.6/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
self.loader = MigrationLoader(self.connection)
File "/opt/IBM/Python2.6/lib/python2.7/site-packages/django/db/migrations/loader.py", line 52, in __init__
self.build_graph()
File "/opt/IBM/Python2.6/lib/python2.7/site-packages/django/db/migrations/loader.py", line 209, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/opt/IBM/Python2.6/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
self.ensure_schema()
File "/opt/IBM/Python2.6/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in ensure_schema
raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position 6: ordinal not in range(128)
我没有配置任何其他的东西,只是试图启动开发服务器,但它失败了。
请在您的设置中包含相关的数据库配置?您似乎在某处有一个与非ASCII数据库相关的名称。 –
如果你刚开始,切换到Python3 – WombatPM
感谢彼得!你能帮我怎么配置数据库配置...我的意思是哪个文件? @WombatPM我有计划使用pymqi模块.....不知道Python3支持pymqi模块 – user3171821