gpt4 book ai didi

django - 我正面临启动 runserver django?

转载 作者:行者123 更新时间:2023-12-03 16:30:28 27 4
gpt4 key购买 nike

运行服务器时出现以下错误。我使用 Django ===1.10.2 和默认的 sqlite3 数据库作为后端。但我有以下异常(exception):

python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x7f56983c3140>
Traceback (most recent call last):
File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 124, in inner_run
self.check_migrations()
File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/core/management/base.py", line 437, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 52, in __init__
self.build_graph()
File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 203, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
self.ensure_schema()
File "/home/nidhinjames/popo/popo/mysite/venv/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)

任何解决方案都可以赞赏????

最佳答案

您似乎在某处设置了一个奇怪的字符,很可能是在 django 设置中指定的 sqlite 文件的名称中。

Django 在尝试做时死了 raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc) - 执行此操作时遇到 UNICODE 错误,该错误表明 0xf1 不是 ASCII 的一部分。基于 this table这是字符± .由于 django 绝对不会使用它作为表名,我想它必须与文件名有关。

如果不是这种情况,请尝试 grep '±' .在您的项目文件夹中查找此字符的用法。 HTH

关于django - 我正面临启动 runserver django?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40110505/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com