Mercurial > piecrust2
comparison foodtruck/config.py @ 597:79a31a3c947b
admin: Better production config for FoodTruck, provide proper first site.
* Use a `settings` object to configure Flask.
* Accept an `app.cfg` file in the admin folder to configure Flask.
* Get a proper first site name when the cookie isn't set yet.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 20 Jan 2016 21:39:18 -0800 |
parents | d4a01a023998 |
children |
comparison
equal
deleted
inserted
replaced
596:e2c91ba44d6c | 597:79a31a3c947b |
---|---|
8 | 8 |
9 | 9 |
10 logger = logging.getLogger(__name__) | 10 logger = logging.getLogger(__name__) |
11 | 11 |
12 | 12 |
13 def get_foodtruck_config(): | 13 def get_foodtruck_config(dirname=None): |
14 cfg_path = os.path.join(os.getcwd(), 'foodtruck.yml') | 14 dirname = dirname or os.getcwd() |
15 cfg_path = os.path.join(dirname, 'foodtruck.yml') | |
15 return FoodTruckConfiguration(cfg_path) | 16 return FoodTruckConfiguration(cfg_path) |
16 | 17 |
17 | 18 |
18 class FoodTruckConfigNotFoundError(Exception): | 19 class FoodTruckConfigNotFoundError(Exception): |
19 pass | 20 pass |