Django 错误 TypeError: unsupported operand type(s) for PosixPath and str

在学习Django模版的时候,遇到了如下错误。

root@iZ2ze4r3b4xczuujolp68uZ:~/Detection# python3 manage.py runserver 0.0.0.0:8006
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/dist-packages/Django-3.1a1-py3.6.egg/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/dist-packages/Django-3.1a1-py3.6.egg/django/core/management/__init__.py", line 345, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python3.6/dist-packages/Django-3.1a1-py3.6.egg/django/conf/__init__.py", line 77, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.6/dist-packages/Django-3.1a1-py3.6.egg/django/conf/__init__.py", line 64, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.6/dist-packages/Django-3.1a1-py3.6.egg/django/conf/__init__.py", line 171, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 955, in _find_and_load_unlocked
  File "", line 665, in _load_unlocked
  File "", line 678, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/root/Detection/Detection/settings.py", line 57, in <module>
    'DIRS': [BASE_DIR+"/templates",],
TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'

Django 错误 TypeError: unsupported operand type(s) for PosixPath and str_第1张图片
虽然是按照教程走的,但是这里不知道为什么错,不过唯一的区别是,整个列表都是用的单引号,最后把双引号改成单引号就ok了。

你可能感兴趣的:(Django)