新建django项目出现TypeError: unsupported operand type(s) for /: 'str' and 'str'问题
TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', # 'DIRS': [BASE_DIR / 'templates'] 'DIRS': [os.path.join(BASE_DIR, 'templates')] , 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ],
在settings.py中找到上面代码,把DIRS那行注释掉,用下面一行代替即可解决问题。

浙公网安备 33010602011771号