About File Upload Permissions

Note that the FILE_UPLOAD_PERMISSIONS setting is used in two cases:

  • For uploaded files, somewhere under MEDIA_URL directory.
  • For files created by collectstatic management command, somewhere under STATIC_URL directory.

If you set wrong file permissions or your web server settings, you might get "403 Forbidden" error when accessing those files from the browser. The default value is 0o644, readable and writable by the project's user, and only readable by others. Better stick with it.

Tips and Tricks Programming Dev Ops Architecture Django 4.2 Django 3.2 Django 2.2 nginx Apache