@@ -1028,6 +1028,8 @@ def __call__(self, environ, start_response):
10281028import mod_wsgi.server
10291029
10301030working_directory = '%(working_directory)s'
1031+ python_paths = %(python_paths)s
1032+
10311033entry_point = '%(entry_point)s'
10321034application_type = '%(application_type)s'
10331035callable_object = '%(callable_object)s'
@@ -1044,6 +1046,9 @@ def __call__(self, environ, start_response):
10441046enable_profiler = %(enable_profiler)s
10451047profiler_output_file = '%(profiler_output_file)s'
10461048
1049+ if python_paths:
1050+ sys.path.extend(python_paths)
1051+
10471052if debug_mode:
10481053 # We need to fiddle sys.path as we are not using daemon mode and so
10491054 # the working directory will not be added to sys.path by virtue of
@@ -1689,6 +1694,14 @@ def check_percentage(option, opt_str, value, parser):
16891694 default = apxs_config .ROTATELOGS , metavar = 'FILE-PATH' ,
16901695 help = 'Override the path to the rotatelogs executable.' ),
16911696
1697+ optparse .make_option ('--python-path' , action = 'append' ,
1698+ dest = 'python_paths' , metavar = 'DIRECTORY-PATH' , help = 'Specify '
1699+ 'the path to any additional directory that should be added to '
1700+ 'the Python module search path. Note that these directories will '
1701+ 'not be processed for \' .pth\' files. If processing of \' .pth\' '
1702+ 'files is required, set the \' PYTHONPATH\' environment variable '
1703+ 'in a script specified by the \' --envvars-script\' option.' ),
1704+
16921705 optparse .make_option ('--python-eggs' , metavar = 'DIRECTORY-PATH' ,
16931706 help = 'Specify an alternate directory which should be used for '
16941707 'unpacking of Python eggs. Defaults to a sub directory of '
0 commit comments