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 ' )