Skip to content

Commit ea9c33b

Browse files
Merge branch 'release/4.5.19'
2 parents 7c6afb1 + 1e02f60 commit ea9c33b

File tree

4 files changed

+35
-14
lines changed

4 files changed

+35
-14
lines changed

docs/release-notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Release Notes
55
.. toctree::
66
:maxdepth: 2
77

8+
release-notes/version-4.5.19
89
release-notes/version-4.5.18
910
release-notes/version-4.5.17
1011
release-notes/version-4.5.16
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
==============
2+
Version 4.5.19
3+
==============
4+
5+
Version 4.5.19 of mod_wsgi can be obtained from:
6+
7+
https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.5.19
8+
9+
Features Changed
10+
----------------
11+
12+
* When using the Django management command integration of
13+
``mod_wsgi-express``, allow the ``--working-directory`` option to
14+
override the calculated directory. This is necessary to cope with
15+
where the meaning of ``BASE_DIR`` in the Django settings file has been
16+
changed from the accepted convention of it being the parent directory
17+
of the Django project.

src/server/management/commands/runmodwsgi.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,21 @@ def handle(self, *args, **options):
7878
args = [script_file]
7979
options['callable_object'] = callable_object
8080

81-
# If there is no BASE_DIR in Django settings, assume that
82-
# the current working directory is the parent directory of
83-
# the directory the settings module is in.
84-
85-
if hasattr(settings, 'BASE_DIR'):
86-
options['working_directory'] = settings.BASE_DIR
87-
else:
88-
settings_module_path = os.environ['DJANGO_SETTINGS_MODULE']
89-
root_module_path = settings_module_path.split('.')[0]
90-
root_module = sys.modules[root_module_path]
91-
parent = os.path.dirname(os.path.dirname(root_module.__file__))
92-
options['working_directory'] = parent
81+
# If there is no BASE_DIR in Django settings, assume that the
82+
# current working directory is the parent directory of the
83+
# directory the settings module is in. Either way, allow the
84+
# --working-directory option to override it to deal with where
85+
# meaning of BASE_DIR in the Django settings was changed.
86+
87+
if options.get('working_directory') is None:
88+
if hasattr(settings, 'BASE_DIR'):
89+
options['working_directory'] = settings.BASE_DIR
90+
else:
91+
settings_module_path = os.environ['DJANGO_SETTINGS_MODULE']
92+
root_module_path = settings_module_path.split('.')[0]
93+
root_module = sys.modules[root_module_path]
94+
parent = os.path.dirname(os.path.dirname(root_module.__file__))
95+
options['working_directory'] = parent
9396

9497
url_aliases = options.setdefault('url_aliases') or []
9598

src/server/wsgi_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#define MOD_WSGI_MAJORVERSION_NUMBER 4
2727
#define MOD_WSGI_MINORVERSION_NUMBER 5
28-
#define MOD_WSGI_MICROVERSION_NUMBER 18
29-
#define MOD_WSGI_VERSION_STRING "4.5.18"
28+
#define MOD_WSGI_MICROVERSION_NUMBER 19
29+
#define MOD_WSGI_VERSION_STRING "4.5.19"
3030

3131
/* ------------------------------------------------------------------------- */
3232

0 commit comments

Comments
 (0)