The relevant folders in my django project are here.
-config (folder)
--settings (folder)
---common.py
---production.py
-core (folder)
--management (folder)
---commands (folder)
---my_command.py
I have a variable called MYVAR. If I put it in common.py and import it into my_command.py like so, it works.
from django.conf import settings
class Command(BaseCommand):
def handle(self, *args, **options):
test = settings.MYVAR
But if I put MYVAR in production.py and run the same code snippet, it can't find the variable.
What's going on here? common.py and production.py are in the same folder (settings). Why is it not importing from production.py?