执行python manage.py startapp system命令报错
报错内容:
TypeError: unsupported operand type(s) for /: 'str' and 'str'
本 10.0.18363.1139]
(c) 2019 Microsoft Corporation。保留所有权利。
(py3.7) C:\Users\klsml\Desktop\常用文件\py_learn\django_mall>python manage.py startapp system
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\klsml\envs\py3.7-FwvP4-65\lib\site-packages\django\core\management\__init__.py", line 364, i
n execute_from_command_line
utility.execute()
File "C:\Users\klsml\envs\py3.7-FwvP4-65\lib\site-packages\django\core\management\__init__.py", line 308, i
n execute
settings.INSTALLED_APPS
File "C:\Users\klsml\envs\py3.7-FwvP4-65\lib\site-packages\django\conf\__init__.py", line 56, in __getattr_
_
self._setup(name)
File "C:\Users\klsml\envs\py3.7-FwvP4-65\lib\site-packages\django\conf\__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "C:\Users\klsml\envs\py3.7-FwvP4-65\lib\site-packages\django\conf\__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Users\klsml\envs\py3.7-FwvP4-65\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\klsml\Desktop\常用文件\py_learn\django_mall\django_mall\settings.py", line 57, in <module>
'DIRS': [BASE_DIR / 'templates']
TypeError: unsupported operand type(s) for /: 'str' and 'str'
百度查不到想要的结果,也不知道从何下手,请老师帮助,谢谢
正在回答 回答被采纳积分+1
自己解决了
File "C:\Users\klsml\Desktop\常用文件\py_learn\django_mall\django_mall\settings.py", line 57, in <module>
'DIRS': [BASE_DIR / 'templates']
中 'DIRS': [BASE_DIR后面的斜杠改成逗号就可以了
- 参与学习 人
- 提交作业 218 份
- 解答问题 3562 个
本阶段带你用Python开发一个网站,学习主流框架Django+Flask是Python Web开发的第一步,在基础知识上实现积分商城的项目开发,体验真实的项目开发流程,提高解决编程问题和效率的能力。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星