details: https://code.tryton.org/tryton/commit/56aa903ed852
branch: 6.0
user: Cédric Krier <[email protected]>
date: Wed Jan 21 19:12:34 2026 +0100
description:
Add environment variable to enable development mode
Closes #14530
(grafted from b251595fa8aa5524ec888bc384743da3bb3b7a5d)
diffstat:
trytond/doc/topics/start_server.rst | 1 +
trytond/trytond/commandline.py | 1 +
trytond/trytond/wsgi.py | 2 +-
3 files changed, 3 insertions(+), 1 deletions(-)
diffs (34 lines):
diff -r 19ce5a9295fd -r 56aa903ed852 trytond/doc/topics/start_server.rst
--- a/trytond/doc/topics/start_server.rst Thu Feb 19 13:07:37 2026 +0100
+++ b/trytond/doc/topics/start_server.rst Wed Jan 21 19:12:34 2026 +0100
@@ -32,6 +32,7 @@
* ``TRYTOND_COROUTINE``: Use coroutine for concurrency.
* ``TRYTOND_DATABASE_NAMES``: A list of database names in CSV format, using
python default dialect.
+ * ``TRYTOND_DEV``: A boolean to enable development mode.
.. warning:: You must manage to serve the static files from the web root.
diff -r 19ce5a9295fd -r 56aa903ed852 trytond/trytond/commandline.py
--- a/trytond/trytond/commandline.py Thu Feb 19 13:07:37 2026 +0100
+++ b/trytond/trytond/commandline.py Wed Jan 21 19:12:34 2026 +0100
@@ -28,6 +28,7 @@
parser.add_argument("-v", "--verbose", action='count',
dest="verbose", default=0, help="enable verbose mode")
parser.add_argument('--dev', dest='dev', action='store_true',
+ default=bool(int(os.getenv('TRYTOND_DEV', 0))),
help='enable development mode')
parser.add_argument("-d", "--database", dest="database_names", nargs='+',
diff -r 19ce5a9295fd -r 56aa903ed852 trytond/trytond/wsgi.py
--- a/trytond/trytond/wsgi.py Thu Feb 19 13:07:37 2026 +0100
+++ b/trytond/trytond/wsgi.py Wed Jan 21 19:12:34 2026 +0100
@@ -65,7 +65,7 @@
})
self.protocols = [JSONProtocol, XMLProtocol]
self.error_handlers = []
- self.dev = False
+ self.dev = bool(int(os.getenv('TRYTOND_DEV', 0)))
def route(self, string, methods=None, defaults=None):
def decorator(func):