I am reading http://www.djangobook.com/en/2.0/chapter04.html which follows Django 1.4 but I use Django 1.6 so how to set the template directory in Django 1.6 as settings.py doesn’t have TEMPLATE_DIRS variable and why the developers changed this? Thanks in advance.
Add to settings.py
from os.path import join
TEMPLATE_DIRS = (
join(BASE_DIR, 'templates'),
)
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
)
Add this to settings.py
. In django 1.6 BASE_DIR
is defined. Otherwise define BASE_DIR
as
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With