| 67 | |
| 68 | |
| 69 | def _is_dev_mode(): |
| 70 | # Some embedded python interpreters won't have sys.arv |
| 71 | # For details, see https://github.com/webpy/webpy/issues/87 |
| 72 | argv = getattr(sys, "argv", []) |
| 73 | |
| 74 | # quick hack to check if the program is running in dev mode. |
| 75 | if ( |
| 76 | "SERVER_SOFTWARE" in os.environ |
| 77 | or "PHP_FCGI_CHILDREN" in os.environ |
| 78 | or "fcgi" in argv |
| 79 | or "fastcgi" in argv |
| 80 | or "mod_wsgi" in argv |
| 81 | ): |
| 82 | return False |
| 83 | return True |
| 84 | |
| 85 | |
| 86 | # When running the builtin-server, enable debug mode if not already set. |