Skip to content Skip to sidebar Skip to footer

Python Name 'os' Is Not Defined

I am trying to run this python module from settings import PROJECT_ROOT DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends

Solution 1:

Just add:

import os

in the beginning, before:

from settings importPROJECT_ROOT

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

Solution 2:

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

import os

And everything should be fine. Hope this helps!

Post a Comment for "Python Name 'os' Is Not Defined"