Update rb-site to Use a template file to generate settings_local.py.
Review Request #11372 — Created Jan. 12, 2021 and submitted — Latest diff uploaded
Previously,
rb-site
would hand-craft asettings_local.py
for the
generated site. This was a bit messy to maintain, though, and very
limiting. A request we've had in the past is to allow a custom template
to be passed torb-site
, and we had no way to offer this for this
file.This change moves us to using a template file, in the same format as the
others we generate (like for crontabs). We build the data up-front, pass
it to the template, and write it to the site directory.There are some differences. Because we're having to use
json
to
generate the structured data, we're stuck with some annoyances like a
lack of trailing commas in lists/dictionaries, and double quotes instead
of single quotes. Not a big deal, since this file isn't meant to be
worked with all that much, and these are purely stylistic differences,
but there isn't a better approach without a whole lot of extra work.
Unit tests pass.
Ran
rb-site install
and verified the resulting file looked correct and
had the proper generated settings.