djangodjango-file-upload

What's the difference between MEDIA_ROOT = BASE_DIR / 'media'` and MEDIA_ROOT= os.path.join(BASE_DIR, "media") in Django setting.py


I wanted to know the difference between using MEDIA_ROOT = BASE_DIR / 'media' and MEDIA_ROOT= os.path.join(BASE_DIR, "media") in settings.py.


Solution

  • MEDIA_ROOT = BASE_DIR / 'media'
    

    utilizes pathlib library

    MEDIA_ROOT = os.path.join(BASE_DIR, "media")
    

    utilizes os library

    The default library depends on which version of Django you employ.

    What do you mean by deleting and uploading can you give more detail?