Django kernel exceptions Incorrectly configured:

django.core.exceptions.ImproperlyConfigured:

The TEMPLATE_DIRS parameter must be a tuple. Correct your settings.

This is my settings.py file code

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/"
+4
source share
1 answer

it seems that the path specified in TEMPLATE_DIRSis incorrect. You can specify a path, for example

import os
PROJECT_PATH = os.path.dirname(os.path.realpath(__file__))

TEMPLATE_DIRS = (os.path.join(PROJECT_PATH, '../templates'),)

where templatesis the directory where your templates are located.

+3
source

All Articles