How do I reference a Django settings variable in my models.py?

Try with this: from django.conf import settings then settings.VARIABLE to access that variable.

VARIABLE should be in capital letter. It will not work otherwise.


from django.conf import settings

PRIVATE_DIR = getattr(settings, "PRIVATE_DIR", None)

Where it says None, you will put a default value incase the variable isn't defined in settings.