gpt4 book ai didi

python - 属性错误 : 'tuple' object has no attribute 'rsplit' Django

转载 作者:行者123 更新时间:2023-11-28 21:20:21 26 4
gpt4 key购买 nike

我是 django 的新手,在运行命令 python manage.py collectstatic 后出现此错误

Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/bradfordli/Development/django_tutorial/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/Users/bradfordli/Development/django_tutorial/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/bradfordli/Development/django_tutorial/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Users/bradfordli/Development/django_tutorial/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/core/management/__init__.py", line 76, in load_command_class
return module.Command()
File "/Users/bradfordli/Development/django_tutorial/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/contrib/staticfiles/management/commands/collectstatic.py", line 58, in __init__
self.storage.path('')
File "/Users/bradfordli/Development/django_tutorial/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/utils/functional.py", line 213, in inner
self._setup()
File "/Users/bradfordli/Development/django_tutorial/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/contrib/staticfiles/storage.py", line 311, in _setup
self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)()
File "/Users/bradfordli/Development/django_tutorial/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/core/files/storage.py", line 282, in get_storage_class
return import_by_path(import_path or settings.DEFAULT_FILE_STORAGE)
File "/Users/bradfordli/Development/django_tutorial/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/utils/module_loading.py", line 16, in import_by_path
module_path, class_name = dotted_path.rsplit('.', 1)
AttributeError: 'tuple' object has no attribute 'rsplit'

当我运行服务器时,这是输出

http://pastebin.com/2bh7h7gY

最佳答案

settings.py 中的一个设置是一个元组,或者有一个不必要的尾随逗号,这将把它变成一个元组,但它不应该是。它应该是一个字符串。

我首先查看 STATICFILES_STORAGEDEFAULT_FILE_STORAGE

关于python - 属性错误 : 'tuple' object has no attribute 'rsplit' Django,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22977285/

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