From RENDERED lines to jinja!?

6 views
Skip to first unread message

Telis

unread,
Jun 1, 2018, 4:16:21 AM6/1/18
to pocoo-libs
Hello!

I've got a situation of properties files - one per host of a cluster - which were customised manually long time ago; now i've got to figure out if and how lines/strings that are "slightly" different can be "templetised". say,

prop file1

prop file2

prop file3

What's the algorithm to produce:

prop.j2
url=http://{{ host }}:{{ port }}

1.props
host=app01
port=11345

2.props
host=app12
port=12345

3.props
host=app13
port=12345

Thanks in advance!

Alan Hicks

unread,
Jun 1, 2018, 5:46:37 AM6/1/18
to pocoo...@googlegroups.com, Telis
Perhaps in settings.py

MY_HOST = http://app01:11345

Then in template
{{ settings.MY_HOST }}
Reply all
Reply to author
Forward
0 new messages