@@ -1370,8 +1370,18 @@ def __call__(self, environ, start_response):
1370
1370
profiler_directory = '%(profiler_directory)s'
1371
1371
enable_recorder = %(enable_recorder)s
1372
1372
recorder_directory = '%(recorder_directory)s'
1373
+ enable_gdb = %(enable_gdb)s
1374
+
1375
+ os.environ['MOD_WSGI_EXPRESS'] = 'true'
1376
+ os.environ['MOD_WSGI_SERVER_NAME'] = '%(server_host)s'
1377
+ os.environ['MOD_WSGI_SERVER_ALIASES'] = %(server_aliases)r or ''
1378
+
1379
+ if reload_on_changes:
1380
+ os.environ['MOD_WSGI_RELOADER_ENABLED'] = 'true'
1373
1381
1374
1382
if debug_mode:
1383
+ os.environ['MOD_WSGI_DEBUG_MODE'] = 'true'
1384
+
1375
1385
# We need to fiddle sys.path as we are not using daemon mode and so
1376
1386
# the working directory will not be added to sys.path by virtue of
1377
1387
# 'home' option to WSGIDaemonProcess directive. We could use the
@@ -1380,11 +1390,16 @@ def __call__(self, environ, start_response):
1380
1390
1381
1391
sys.path.insert(0, working_directory)
1382
1392
1393
+ if enable_debugger:
1394
+ os.environ['MOD_WSGI_DEBUGGER_ENABLED'] = 'true'
1395
+
1383
1396
def output_coverage_report():
1384
1397
coverage_info.stop()
1385
1398
coverage_info.html_report(directory=coverage_directory)
1386
1399
1387
1400
if enable_coverage:
1401
+ os.environ['MOD_WSGI_COVERAGE_ENABLED'] = 'true'
1402
+
1388
1403
from coverage import coverage
1389
1404
coverage_info = coverage()
1390
1405
coverage_info.start()
@@ -1397,11 +1412,19 @@ def output_profiler_data():
1397
1412
profiler_info.dump_stats(output_file)
1398
1413
1399
1414
if enable_profiler:
1415
+ os.environ['MOD_WSGI_PROFILER_ENABLED'] = 'true'
1416
+
1400
1417
from cProfile import Profile
1401
1418
profiler_info = Profile()
1402
1419
profiler_info.enable()
1403
1420
atexit.register(output_profiler_data)
1404
1421
1422
+ if enable_recorder:
1423
+ os.environ['MOD_WSGI_RECORDER_ENABLED'] = 'true'
1424
+
1425
+ if enable_gdb:
1426
+ os.environ['MOD_WSGI_GDB_ENABLED'] = 'true'
1427
+
1405
1428
if with_newrelic_agent:
1406
1429
if newrelic_config_file:
1407
1430
os.environ['NEW_RELIC_CONFIG_FILE'] = newrelic_config_file
@@ -2714,6 +2737,8 @@ def _cmd_setup_server(command, args, options):
2714
2737
else :
2715
2738
host = options ['host' ]
2716
2739
2740
+ options ['server_host' ] = host
2741
+
2717
2742
if options ['port' ] == 80 :
2718
2743
options ['url' ] = 'http://%s/' % host
2719
2744
else :
0 commit comments