djangofile-permissionsdirectory-permissions

How to secure a created directory in django so that only django app can access it


I've created a directory in Django 'mydir' and have few files in it. How to secure these files so that only django can access it and no one else?


Solution

  • It can be done by the following:

    os.chmod('mydir', 0o400)