details:   https://code.tryton.org/tryton/commit/b251595fa8aa
branch:    default
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
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 8dba20989765 -r b251595fa8aa trytond/doc/topics/start_server.rst
--- a/trytond/doc/topics/start_server.rst       Tue Jan 20 17:31:26 2026 +0100
+++ b/trytond/doc/topics/start_server.rst       Wed Jan 21 19:12:34 2026 +0100
@@ -42,6 +42,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 8dba20989765 -r b251595fa8aa trytond/trytond/commandline.py
--- a/trytond/trytond/commandline.py    Tue Jan 20 17:31:26 2026 +0100
+++ b/trytond/trytond/commandline.py    Wed Jan 21 19:12:34 2026 +0100
@@ -75,6 +75,7 @@
     parser.add_argument("-v", "--verbose", action='count',
         dest="verbose", default=0, help="increase verbosity")
     parser.add_argument('--dev', dest='dev', action='store_true',
+        default=bool(int(os.getenv('TRYTOND_DEV', 0))),
         help='enable development mode')
 
     logging_config = os.environ.get('TRYTOND_LOGGING_CONFIG')
diff -r 8dba20989765 -r b251595fa8aa trytond/trytond/wsgi.py
--- a/trytond/trytond/wsgi.py   Tue Jan 20 17:31:26 2026 +0100
+++ b/trytond/trytond/wsgi.py   Wed Jan 21 19:12:34 2026 +0100
@@ -70,7 +70,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):

Reply via email to