[Django]-Django: Check if settings variable is set

93👍

It seemed you’ve made it the correct way: import setting object and check.

And you can try to use:

if hasattr(settings, 'ANOTHER_VARIABLE'):

instead of:

if settings.is_defined('ANOTHER_VARIABLE'):

I found the documentation, hope this might help.

Leave a comment