TianyuSun,
I did try manually setting DJANGO_SETTINGS_MODULE and SECRET_KEY manually as noted above but it still had the same error. I have solved the issue by stepping into the code in debug I found that the init.py file was executing then it was exiting the program without going to the settings.py file. So in the init.py file I added
from .base import *
env_name = os.getenv('ENV_NAME', 'local')
if env_name == 'prod':
from .prod import *
elif env_name == 'dev':
from .dev import *
else:
from .local import *
This did resolve the issue.