I'm attempting to diagnose why my app is not finding it's settings file.
The settings are displayed on the bottom of the Django toolbar, but the traceback shows the error:
UndefinedError: 'settings' is undefined
I added the following to my code to get see why the settings weren't found because they are visable from the shell and on on the Python path.
import logging
logging.debug("settings.LANGUAGE_CODE: " settings.LANGUAGE_CODE)
Nothing showed up in the log file defined in the settings.py file.
Here is how the settings are defined:
LOG_FILENAME = 'askbot.log'
logging.basicConfig(
filename=os.path.join(os.path.dirname(__file__), 'log', LOG_FILENAME),
level=logging.CRITICAL,
format='%(pathname)s TIME: %(asctime)s MSG: %(filename)s:%(funcName)s:%(lineno)d %(message)s',
)
I attempted to log a message directly from the shell:
>> import logging
>> logging.debug("does this show up in log file")
Nothing showed up in the log file.
I attempted to view the logging configuration via the shell.
>> logging.__dict__
>> logging.basicConfig.__dict__
LOG_FILENAME was never displayed.
How can I figure out why the logging messages are not being displayed in the LOG_FILENAME?
Can logging messages be sent from the shell to test the configuration?