Loading...

Django框架,'DIRS': [BASE_DIR/'templates'], TypeError: unsupported operand type(s) for /: 'str' and 'str'

报错:
'DIRS': [BASE_DIR/'templates'],
TypeError: unsupported operand type(s) for /: 'str' and 'str'
Django框架,'DIRS': [BASE_DIR/'templates'], TypeError: unsupported operand type(s) for /: 'str' and 'str'
解决:
该问题就是把‘/’识别为除号了,两个str无法进行除号。代码实际意思是将两个str进行拼接,进入settings.py进行如下修改:
Django框架,'DIRS': [BASE_DIR/'templates'], TypeError: unsupported operand type(s) for /: 'str' and 'str'

相关文章

暂无评论

暂无评论...