Open dantownsend opened 3 years ago
Issue https://github.com/piccolo-orm/piccolo/issues/323 gave me some ideas about improvements to the way Piccolo looks for a piccolo_conf.py file.
piccolo_conf.py
I'm just documenting them here as ideas - they could be developed in the future if people think they're needed.
PICCOLO_CONF
The PICCOLO_CONF environment variable could accept a comma separated list of paths, in case you wanted Piccolo to look in multiple places.
# Piccolo would search for piccolo_conf.py in the current directory, and in an 'app' sub directory export PICCOLO_CONF="piccolo_conf,app.piccolo_conf"
--piccolo_conf
When using the piccolo CLI, an extra parameter could be added which specifies where to look for the piccolo_conf.py file:
piccolo
piccolo migrations check --piccolo_conf=app.piccolo_conf
The contents would be something like:
PICCOLO_CONF=piccolo_conf_test
The precedence for finding a piccolo_conf.py file would then be as follows:
.piccolo
I like these ideas, especially .piccolo. it seems like a permanent solution.
Issue https://github.com/piccolo-orm/piccolo/issues/323 gave me some ideas about improvements to the way Piccolo looks for a
piccolo_conf.py
file.I'm just documenting them here as ideas - they could be developed in the future if people think they're needed.
1.
PICCOLO_CONF
changesThe
PICCOLO_CONF
environment variable could accept a comma separated list of paths, in case you wanted Piccolo to look in multiple places.2. Add
--piccolo_conf
option to the CLIWhen using the
piccolo
CLI, an extra parameter could be added which specifies where to look for thepiccolo_conf.py
file:3. .piccolo file
The contents would be something like:
The precedence for finding a
piccolo_conf.py
file would then be as follows:PICCOLO_CONF
environment variable exists, use this..piccolo
file in the current directory, and use that.piccolo_conf.py