0

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')]
wfehr
  • 2,185
  • 10
  • 21
Awais Raza
  • 55
  • 1
  • 9

1 Answers1

0

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

You can check here and here

Higor Rossato
  • 1,996
  • 1
  • 10
  • 15
  • And when more, Where can i check the migrated models data. Like GUI tool like xampp or any command to show the models in cmd or any other. – Awais Raza Oct 09 '19 at 08:07