-
-
Notifications
You must be signed in to change notification settings - Fork 271
Description
Hi, I've been using the Django management command runmodwsgi for many projects, usually without issue. However, I just started a new project and this time I got an error: "PosixPath object has no attribute 'endswith'." The error is triggered on line 1093 in /server/init.py.
I did some debugging and discovered that the "target" object on that line was a Path object pointing to the directory defined by the STATIC_ROOT setting. Older versions of Django used the os.path.join() method to define that directory, which returns a string, but new versions encourage using the pathlib.Path approach, something like STATIC_ROOT = BASE_DIR / 'collect_static'.
Obviously I can just cast that as a string within the settings file, but I imagine more and more users will have that defined as a Path object. For compatibility you might want to explicitly cast the "target" object as a string so other users don't encounter the same issue.
Thanks for the mod_wsgi package, I've used it extensively for years.