If you try running this in the repl, you'll see that:
>>> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))),
>>> BASE_DIR
('c:\\srv',)
>>> isinstance(BASE_DIR, tuple)
True
>>> os.path.join(BASE_DIR, 'templates')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\ntpath.py", line 84, in join
result_path = result_path + '\\'
TypeError: can only concatenate tuple (not "str") to tuple
>>>
the problem is the , at the end of
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))),
^
| this one
it works if you remove it:
>>> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd())))
>>> os.path.join(BASE_DIR, 'templates')
'c:\\srv\\templates'
in Python a comma is used to create tuples (even though many people think it's the parenthesis):
>>> 1,2,3
(1, 2, 3)
a two element tuple:
>>> 1,2
(1, 2)
and a one-element tuple:
>>> 1,
(1,)