Skip to content

Instantly share code, notes, and snippets.

@Sheikh2Imran
Last active December 20, 2019 11:31
Show Gist options
  • Select an option

  • Save Sheikh2Imran/7860fb6c3d87f3e2e88f0060fb045c78 to your computer and use it in GitHub Desktop.

Select an option

Save Sheikh2Imran/7860fb6c3d87f3e2e88f0060fb045c78 to your computer and use it in GitHub Desktop.
How to setup template path in Django settings.py
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'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',
],
},
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment