error message if config could not be loaded
This commit is contained in:
parent
5e134e5b41
commit
e4c7fd508e
1 changed files with 4 additions and 2 deletions
|
@ -11,8 +11,10 @@ from django.utils.crypto import get_random_string
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
config = configparser.RawConfigParser()
|
||||
config.read(['/etc/c3nav/c3nav.cfg', os.path.expanduser('~/.c3nav.cfg'), os.environ.get('C3NAV_CONFIG', 'c3nav.cfg')],
|
||||
encoding='utf-8')
|
||||
if 'C3NAV_CONFIG' in os.environ:
|
||||
config.read_file(open(os.environ.get('C3NAV_CONFIG'), encoding='utf-8'))
|
||||
else:
|
||||
config.read(['/etc/c3nav/c3nav.cfg', os.path.expanduser('~/.c3nav.cfg'), 'c3nav.cfg'], encoding='utf-8')
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue