Fix to address issues with handling pathlib-based paths - Closes #49 #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In more recent versions of Django, the
django-admin startproject
script creates a settings file where BASE_DIR is specified usingpathlib.Path
. In older versions it was set usingos.path
.django-drf-filepond has some code that attempts to use string functions on
BASE_DIR
assuming that it is a string. However, if thestartproject
command was used and the defaultBASE_DIR
setting is left in place, this will cause issues in certain circumstances.This fix addresses these problems while also retaining support for Python 2.7 (despite being well beyond EOL, aiming to keep support for legacy apps using django-drf-filepond for now), which doesn't have the
pathlib
module. The fix also retainins support for Python 3.5 which does havepathlib
, but where theos.path.join
function, which is also used withBASE_DIR
in this library, can't acceptpathlib.Path
obejcts as parameters.