[Answered ]-How to verify if django settings are applied correctly?

1👍

Yes, you can import settings and look for your values:

from django.conf import settings

print settings.DEBUG
👤Joseph

1👍

Included in a separate comment was the following from LA_:

“Thanks, Joseph. If I print settings.LOCALE_PATHS, it prints exactly the value I defined. How could I get the full path django uses?”

What may be useful for you to do is record the absolute path by using the os.path module.

For example, you could do the following:

PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
LOCALE_ABS_PATH = os.path.join(PROJECT_PATH, LOCALE_PATHS[0])

Then you could reference LOCALE_ABS_PATH as the absolute path to the LOCALE_DIRS listed in settings.py

Let me know if this is helpful at all. I’m not entirely sure of the context with which you plan to implement that, but perhaps I could help more if you continue to have trouble.

Leave a comment