Template Directory Path

To fix this error:

File "/home/myUser/path/to/project/projectName/projectName/settings.py", line 116, in <module>
  os.path.join(BASE_DIR, 'templates')
NameError: name 'os' is not defined

I had to add this line at the beginning of settings.py:

import os

Then I get this error:

File "/home/myUser/path/to/project/projectName/projectName/settings.py", line 116, in <module>
  os.path.join(BASE_DIR, 'templates')
NameError: name 'BASE_DIR' is not defined

To fix this, I added this line to settings.py:

BASE_DIR = os.path.dirname(os.path.abspath(__file__))

This will return the current file path. You might need to change the os.path.join(BASE_DIR, 'templates') part accordingly.