pando.py icon indicating copy to clipboard operation
pando.py copied to clipboard

Should configuration be read from the environment?

Open Changaco opened this issue 9 years ago • 6 comments

Once https://github.com/AspenWeb/aspen.py/issues/24 is fixed, should Pando continue to read its configuration from the environment? Should it also fill Aspen's configuration from the env?

Changaco avatar Sep 09 '16 10:09 Changaco

Does Pando already? If not, I'm not sure we need to add it. Pando is intended to be used as a library, not a framework.

chadwhitacre avatar Sep 09 '16 17:09 chadwhitacre

Pando currently reads its own configuration from the environment, but not Aspen's. I don't think it makes sense to keep it this way, we should read both or neither.

Changaco avatar Sep 09 '16 18:09 Changaco

@whit537 So, do we drop environment variables entirely?

Changaco avatar Sep 14 '16 15:09 Changaco

Yes. Pando and Aspen are libraries now, not CLIs (with the exception of python -m pando ... are we going to keep PORT and PANDO_HOST there, at least?).

chadwhitacre avatar Sep 14 '16 15:09 chadwhitacre

Objections that come to mind:

  • there are libraries that use environment variables, it's not necessarily a bad practice
  • server admins may appreciate being able to tweak settings without touching the code

Changaco avatar Sep 14 '16 15:09 Changaco

server admins may appreciate being able to tweak settings without touching the code

If that's the case, then their developers should expose their own envvars, which they then pass through to the library, e.g., something like LIBERAPAY_WWW_ROOT instead of {PANDO,ASPEN}_WWW_ROOT.

chadwhitacre avatar Sep 14 '16 15:09 chadwhitacre