[Django]-Django – AttributeError: module 'os' has no attribute 'environment'

6👍

The call should be

os.environ.setdefault('DJANGO_SETTINGS_MODULE','first_project.settings')

For more details you can see previous questions, like this one:
Is it safe to use os.environ.setdefault?

👤holger

Leave a comment