gpt4 book ai didi

django 1.3 服务器错误

转载 作者:行者123 更新时间:2023-12-03 20:29:27 25 4
gpt4 key购买 nike

我使用的是 django 1.3 版。 Python manage.py runserver 0.0.0.0:8000 出现以下错误。

Validating models...

Unhandled exception in thread started by < bound method Command.inner_run of < django.contrib.staticfiles.management.commands.runserver.Command object at 0x20eb110>>

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 88, in inner_run
self.validate(display_num_errors=True)

File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 249, in validate
num_errors = get_validation_errors(s, app)

File "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", line 36, in get_validation_errors
for (app_name, error) in get_app_errors().items():

File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 146, in get_app_errors
self._populate()

File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 64, in _populate
self.load_app(app_name)

File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 78, in load_app
models = import_module('.models', app_name)

File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)

File "/usr/local/lib/python2.7/dist-packages/tastypie/models.py", line 6, in <module>
from tastypie.utils import now

File "/usr/local/lib/python2.7/dist-packages/tastypie/utils/__init__.py", line 1, in <module>
from tastypie.utils.dict import dict_strip_unicode_keys

File "/usr/local/lib/python2.7/dist-packages/tastypie/utils/dict.py", line 1, in <module>
from django.utils.encoding import smart_bytes
ImportError: cannot import name smart_bytes

最佳答案

它与 django 1.4.2+ 配合得很好, 我用的是 django1.4 然后升级了

pip install django==1.4.5 --upgrade

关于django 1.3 服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19675086/

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