Tryton - Issues

 

Issue6344

Title Add environment variables to wsgi script
Priority feature Status testing
Superseder Nosy List ced, pokoli, reviewbot
Type feature request Components trytond
Assigned To pokoli Keywords review
Reviews 32131002
View: 32131002

Created on 2017-03-09.12:52:49 by pokoli, last changed by reviewbot.

Messages
review32131002 updated at https://codereview.tryton.org/32131002/#ps100004
review32131002 updated at https://codereview.tryton.org/32131002/#ps110001
review32131002 updated at https://codereview.tryton.org/32131002/#ps90001
review32131002 updated at https://codereview.tryton.org/32131002/#ps70001
review32131002 updated at https://codereview.tryton.org/32131002/#ps50001
msg32398 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-09.16:06:05
OK then if it is clearly separated.
review32131002 updated at https://codereview.tryton.org/32131002/#ps30001
msg32396 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-03-09.15:39:23
El 09/03/17 a les 15:20, Cédric Krier ha escrit:
>> El 09/03/17 a les 13:25, Cédric Krier ha escrit:
>>> For me, it will just create double way to set options when running
>>> trytond. This will lead to the question which one has the precedence?
>> For me there is no dobule way:
>>
>> When using trytond the only option is to use the flags.
> I do not see how you reach to this conclusion.
> The app is used by trytond so the wsgi app will override configuration
> based on environment variable.

Right this is the current behaviour. But I think we can modify the behaviour and apply environment variables only for uwsgi.
msg32393 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-09.15:20:06
On 2017-03-09 13:56, Sergi Almacellas Abellana wrote:
> El 09/03/17 a les 13:25, Cédric Krier ha escrit:
> > For me, it will just create double way to set options when running
> > trytond. This will lead to the question which one has the precedence?
> 
> For me there is no dobule way:
> 
> When using trytond the only option is to use the flags.

I do not see how you reach to this conclusion.
The app is used by trytond so the wsgi app will override configuration
based on environment variable.
msg32389 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-03-09.13:56:19
El 09/03/17 a les 13:25, Cédric Krier ha escrit:
>> As requested on [1] it will be a good addition to allow to configure some of the wsgi application behaviour by using environemnt variables. Although it's possible to use a custom wsgi script, I think it's a good practice to provide a configurable default one.
> Could you rational why it is good practice?

Because it ease the deployment using wsgi scripts and it simplifies the maintenance of wsgi scripts. 

Because it provides a more detailed example for custom scripts.

Also if it's possible to set a variable using a commandline command, it's expected to be able to set it also when running wsgi. 

> For me, it will just create double way to set options when running
> trytond. This will lead to the question which one has the precedence?

For me there is no dobule way:

When using trytond the only option is to use the flags.
When using wsgi the only option is to use environment variables.
msg32388 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-09.13:25:06
On 2017-03-09 12:52, Sergi Almacellas Abellana wrote:
> As requested on [1] it will be a good addition to allow to configure some of the wsgi application behaviour by using environemnt variables. Although it's possible to use a custom wsgi script, I think it's a good practice to provide a configurable default one.

Could you rational why it is good practice?
For me, it will just create double way to set options when running
trytond. This will lead to the question which one has the precedence?
review32131002 updated at https://codereview.tryton.org/32131002/#ps1
msg32386 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-03-09.12:52:49
As requested on [1] it will be a good addition to allow to configure some of the wsgi application behaviour by using environemnt variables. Although it's possible to use a custom wsgi script, I think it's a good practice to provide a configurable default one.

We should include the following variables:

* TRYTOND_LOGGING_CONFIG: Which will be the route to the file used as logging configuration
* TRYTOND_DATABASE_NAME: The database name to initialize when initialitzing the server. This will be required when implementing issue5694.


[1] http://www.tryton.org/~irclog/2017-03-06.log.html#t2017-03-06%2017:38
History
Date User Action Args
2017-03-17 12:35:38reviewbotsetmessages: + msg32578
2017-03-17 12:02:24reviewbotsetmessages: + msg32577
2017-03-17 11:30:54reviewbotsetmessages: + msg32574
2017-03-17 11:00:14reviewbotsetmessages: + msg32573
2017-03-09 17:06:16reviewbotsetmessages: + msg32401
2017-03-09 16:06:05cedsetmessages: + msg32398
2017-03-09 16:02:36reviewbotsetmessages: + msg32397
2017-03-09 15:39:23pokolisetmessages: + msg32396
2017-03-09 15:20:06cedsetmessages: + msg32393
2017-03-09 13:56:19pokolisetmessages: + msg32389

Showing 10 items. Show all history (warning: this could be VERY long)