Python name 'os' is not defined [duplicate]

Just add:

import os

in the beginning, before:

from settings import PROJECT_ROOT

This will import the python's module os, which apparently is used later in the code of your module without being imported.


The problem is that you forgot to import os. Add this line of code:

import os

And everything should be fine. Hope this helps!