davidskalinder / mpeds-coder

MPEDS Annotation Interface
MIT License
0 stars 0 forks source link

Move everything that varies between projects to a config directory #134

Open davidskalinder opened 3 years ago

davidskalinder commented 3 years ago

So now that template customizations can go in a separate directory and the config options are getting heavier, I'm wondering if it doesn't make sense to put all project-specific customizations into a config directory? So, a deployment's root would retain a thin config.py file that only specifies CONFIG_DIR, and then there's a config dir elsewhere, with its own private version control, that contains the heavy config file as well as all the (non-default) templates and YAMLs.

davidskalinder commented 3 years ago

Hahaha, and you know what else? This functionality is already there! All the YAML locations are specified like this: app.config['WD'] + '/presets.yaml'. Code that I've written also uses WD for two export locations, so we'd just need to split those two use cases.

davidskalinder commented 3 years ago

Okay so although I still think this is a worthwhile task, I don't think I'm going to be able to do it by the time I leave. The problem is that although everything in the controller gets stuff from the config like app.config['WD'], database.py (and a couple of my scripts, which are less important) import config as a module and then do things like config.MYSQL_USER. So changing app.config.from_pyfile()'s argument sets everything properly in the controller, but not from the other places.

It looks like there's a better way to get the app context into stuff like the database config, but it's going to require more learning than I'm going to have time for this week, so this one will have to wait for the post-@davidskalinder era...