When i try to run makemigrations command in django it gave me an error:
TypeError: _getfullpathname: path should be string, bytes or os.PathLike, not list
Help me to resolve this issue.
This is my static root and media roots all stuffs:
# settings.py
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
STATIC_ROOT = [os.path.join(BASE_DIR, 'static_root')]
MEDIA_ROOT = [os.path.join(BASE_DIR, 'media_root')]
STATIC_ROOT
and MEDIA_ROOT
shouldn't be a list and that's why Django is complaining. You should define them like so:
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
STATIC_ROOT = os.path.join(BASE_DIR, 'static_root')
MEDIA_ROOT = os.path.join(BASE_DIR, 'media_root')
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments