archives: correction du texte pour Amélie
[auf_framonde.git] / project / settings.py
CommitLineData
6837e829
PH
1import sys
2import glob
3import types
01b54c21 4
6837e829 5from os.path import abspath, dirname, join
01b54c21 6
6837e829 7from django.conf.global_settings import * # NOQA
01b54c21 8
6837e829 9PROJECT_DIR = abspath(dirname(__file__))
01b54c21 10
6837e829
PH
11conffiles = glob.glob(join(PROJECT_DIR, 'settings', '*.py'))
12conffiles.sort()
01b54c21 13
6837e829
PH
14for f in conffiles:
15 exec(open(abspath(f)).read())
01b54c21 16
6837e829
PH
17 # from https://github.com/2general/django-split-settings/blob/master/split_settings/tools.py
18 # add dummy modules to sys.modules to make runserver autoreload work with
19 # settings components
20 modulename = '_settings.%s' % f
21 module = types.ModuleType(modulename)
22 module.__file__ = f
23 sys.modules[modulename] = module
01b54c21 24
6837e829
PH
25try:
26 from conf import *
27except ImportError:
28 pass