relate icon indicating copy to clipboard operation
relate copied to clipboard

Simplify configuration flow

Open joshuata opened this issue 4 years ago • 1 comments

One source of unexpected bugs in testing was unpredictable settings files chosen (specifically the special casing for get_local_test_settings_file in manage.py. One way I have dealt with this in other django programs was to use other packages to organize settings in a more extensible fashion.

Some options (from least to most involved):

  • django-environ - Pull configuration from environment variables. This would make testing relate with different DBs etc... a lot simpler, and make it much easier to run from a container without needing to override settings files. This could add the option to distribute a Relate docker image that you could run directly without needing to setup your own python environment or webserver
  • django-split-settings - Split settings classes up into different files. This would allow pulling large configuration chunks like saml into their own files to make it easier for a new user to setup their server with customization without worrying about parts that don't apply to them.
  • django-customizations - Use class based settings options. A user's configuration could inherit from the base settings, test settings could inherit from a shared testing class, etc...

joshuata avatar Jun 23 '20 20:06 joshuata

Thanks for starting this discussion!

I'm in principle sympathetic to this. I don't particularly like the get_local_test_settings_file thing, I would like to get rid of it.

django-environ

Does this work when some of the config values are legitimately functions?

django-split-settings

That seems somewhat useful, but does it solve the test config thing?

django-customizations

Of the three, I'm liking this the best. It also has a fairly clear path to solving the test config thing.

inducer avatar Jun 24 '20 22:06 inducer