settings.CONNECTORS_SETTINGS = {
'cmis/test': {
'requests_substitutions': [
{
'url': 'https://service.example.com/api/',
'search': 'http://service.example.internal/software/api/',
'replace': 'https://service.example.com/api/'
}
]
}
}
CONNECTORS_SETTINGS is a new setting to contain any setting pertaining
to a specific connector, it's a dictionnary of dictionnaries indexed by
connectors identifier constructed from the appname and the connector's
slug.
requests_substitutions is the first defined key in this dictionnary,
it's a list of dictionnaries:
* substitution is only done on the following content-types:
text/*, application/(.*\+)?json, application/(.*\+)?xml
* default list of content-types can be changed through the
REQUESTS_SUBSTITUTIONS_CONTENT_TYPES setting.
* scheme and netloc are strictly matched, path must be a prefix or empty
* search is a python regular expression
* url is optionnal, and restrict the substitution to URLs with the same
prefix,
* replace is a replacement string for reb.sub()
* for json, structural replacement is implemented, if eventually
escaping is used.