Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the path for TEMPLATE_DIRS in django settings.py when using virtualenv

I am using virtualenv and I want to know what the TEMPLATE_DIRS in settings.py should be, for example if I make a templates folder in the root of my project folder.

like image 978
weaveoftheride Avatar asked Aug 14 '12 16:08

weaveoftheride


1 Answers

TEMPLATE_DIRS deprecated This setting is deprecated since Django version 1.8.

deprecated

""" settings.py """

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

correct

""" settings.py """

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [ os.path.join(BASE_DIR, 'templates') ],
        'APP_DIRS': True,
        ...
    },
]
like image 81
blessed Avatar answered Sep 19 '22 13:09

blessed