我剛剛安裝了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