Allow setting wsgi configuration with environment variables
issue11307 review375031002
This commit is contained in:
@@ -645,6 +645,10 @@ Example::
|
||||
[wsgi ie]
|
||||
kwargs={'fix_attach': False}
|
||||
|
||||
.. note::
|
||||
The options can be set using environment variables with names like:
|
||||
``TRYTOND_WSGI_<MIDDLEWARE>__<NAME>``.
|
||||
|
||||
|
||||
.. _JSON-RPC: http://en.wikipedia.org/wiki/JSON-RPC
|
||||
.. _XML-RPC: http://en.wikipedia.org/wiki/XML-RPC
|
||||
|
||||
@@ -106,6 +106,8 @@ class TrytonConfigParser(configparser.ConfigParser):
|
||||
section, option = key[len('TRYTOND_'):].lower().split('__', 1)
|
||||
except ValueError:
|
||||
continue
|
||||
if section.startswith('wsgi_'):
|
||||
section = section.replace('wsgi_', 'wsgi ')
|
||||
if not self.has_section(section):
|
||||
self.add_section(section)
|
||||
self.set(section, option, value)
|
||||
|
||||
Reference in New Issue
Block a user