Skip to content

Commit 4cf0413

Browse files
Supposed to covert STATIC_ROOT to str not STATIC_URL.
1 parent 165a1cc commit 4cf0413

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

docs/release-notes/version-5.0.3.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Features Changed
1212
* Django community has started adopting use of `pathlib` module when defining
1313
paths in the Django settings file. This would cause issues for the
1414
`runmodwsgi` management command for Django as it expected strings for
15-
`STATIC_URL` setting. The code has been updated to always convert `STATIC_URL`
16-
to a string in `runmodwsgi` to cope with people using `pathlib` module in
17-
their Django settings file.
15+
`STATIC_ROOT` setting. The code has been updated to always convert
16+
`STATIC_ROOT` to a string in `runmodwsgi` to cope with people using `pathlib`
17+
module in their Django settings file.

src/server/management/commands/runmodwsgi.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ def handle(self, *args, **options):
110110

111111
if 'whitenoise.middleware.WhiteNoiseMiddleware' not in middleware:
112112
static_url = str(settings.STATIC_URL or "")
113+
static_root = str(settings.STATIC_ROOT or "")
113114

114115
if static_url and static_url.startswith('/'):
115-
if settings.STATIC_ROOT:
116+
if static_root:
116117
# We need a fiddle here as depending on the Python
117118
# version used, the list of URL aliases we are
118119
# passed could be either list of tuples or list of
@@ -122,11 +123,11 @@ def handle(self, *args, **options):
122123
if not url_aliases:
123124
url_aliases.insert(0, (
124125
static_url.rstrip('/') or '/',
125-
settings.STATIC_ROOT))
126+
static_root))
126127
else:
127128
url_aliases.insert(0, type(url_aliases[0])((
128129
static_url.rstrip('/') or '/',
129-
settings.STATIC_ROOT)))
130+
static_root)))
130131

131132
except AttributeError:
132133
pass

0 commit comments

Comments
 (0)