Tag Archives: bytes or os.PathLike

‘_getfullpathname: path should be string, bytes or os.PathLike, not tuple’ This error is always reported when debugging the upload file interface

After debugging, I found that the media_root set in the setting added a comma like static, which caused the path to become a tuple, so an error was reported, just delete the comma.

STATIC_URL = ' /static/ ' 
STATICFILES_DIRS = (
    BASE_DIR / ' mytest/dist/static ' ,
)
MEDIA_URL = ' /media/ ' 
MEDIA_ROOT = (BASE_DIR / ' mytest/dist/files ' )