コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
12649 ビュー

Hello, I need a way to differ when I am running my server locally or when I am running it on Odoo.sh. I thought that maybe the easiest way to do so would be to use an environment variable.

When I am running the server locally, I can simply 'export ODOO_ENV="local"' and then access it on python through 'os.environ.get('ODOO_ENV')'.

But is it possible to add environment variable on odoo.sh in a way that I could, for example, differ production from staging?

Thank you!

アバター
破棄
最善の回答

Hello, 

The question date a bit, but I think that the answer lies in you text already. On odoo.sh you can start a shell and an odoo-shell with odoo-bin shell, the inspect the available variables with os.environ.
You'll find the variable ODOO_STAGE which can be dev, staging or production. 

アバター
破棄
関連投稿 返信 ビュー 活動
0
10月 20
4356
2
8月 23
6270
1
7月 25
1665
4
4月 25
11974
1
2月 25
3383