Projet

Général

Profil

« Précédent | Suivant » 

Révision 9003c07e

Ajouté par Jérôme Schneider il y a plus de 9 ans

Centralized config.py into mandaye core

All the configuration is now in ini files.
You could have 3 levels of ini files : * default mandaye core ini file * default mandaye project ini file * optional ini file loading with --config option

Closes #5495

Voir les différences:

mandaye/skel/example.module/wsgi.py
1 1

  
2 2
import os
3
from {project_name} import default_config
3 4

  
4
os.environ.setdefault("MANDAYE_CONFIG_MODULE", "{project_name}.config")
5
if os.environ.has_key('MANDAYE_CONFIG_FILES'):
6
    os.environ['MANDAYE_CONFIG_FILES'] = default_config + ' ' + \
7
            os.environ['MANDAYE_CONFIG_FILES']
8
else:
9
    os.environ['MANDAYE_CONFIG_FILES'] = default_config
5 10

  
6 11
from beaker.middleware import SessionMiddleware
7 12
from whitenoise import WhiteNoise
8 13

  
9
from {project_name} import config
10

  
11 14
import mandaye
15
from mandaye import config
12 16
from mandaye.server import MandayeApp
13 17

  
14 18
# production

Formats disponibles : Unified diff