from future import unicode_literals import os from six.moves.configparser import SafeConfigParser from os import path from . import settings
import logging
def get_config_path(filename): return path.abspath("issue_tracker/config/{}".format(filename))
def config_for_environment(environment): env_filename = "%s.ini" % environment env_path = get_config_path(env_filename) print(env_path)
logging.error(env_path + ' not found!')
config = read_config(env_path)
return config
def read_config(config_file): config = SafeConfigParser() config.read(config_file)
return config
environment = settings.DEFAULT_ENVIRONMENT
sys_config = config_for_environment(environment)
all = [ sys_config, environment ]
IT IS VERY WEIRD
WHAT I GET WHEN THE DJANGO APP is running: /home/zorexsalvo/issue_tracker/config/development.ini
WHAT I GET WHEN I'M IN './manage.py shell': /home/zorexsalvo/bits/issue-tracking-system/issue_tracking/issue_tracker/config/development.ini