django核心异常配置不正确:



django.core.exceptions.ImproverlyConfigure:

TEMPLATE_DIRS设置必须是元组。请修复您的设置。

这是我的设置.py文件代码

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
  )
  STATIC_URL = "/static/"
  ROOT_URLCONF = "%s.urls" % PROJECT_DIR
  TEMPLATE_DIRS = full_path("Home/Downloads/django-socketio-master/djangosocketio/templates")
  #LOGIN_URL = "/admin/"

似乎提供给TEMPLATE_DIRS的路径不正确。您可以提供类似的路径

import os
PROJECT_PATH = os.path.dirname(os.path.realpath(__file__))
TEMPLATE_DIRS = (os.path.join(PROJECT_PATH, '../templates'),)

其中templates是模板所在的目录。

相关内容

最新更新