views:

84

answers:

1

My host Djangohosting puts 777 by default for my Django folders, when I use their one-click Django installer.

I am not sure whether that is safe or not, since everyone can then apparently see my source code.

Which permissions should I use for Django folders at my server?

+2  A: 

Anyone that has access to the files on the machine would actually have access to change your files with those permissions. A lot of times the web server will run under a different User ID (uid) than the uid of your user, so you will probably want to let other users read the files. Given that, you probably want permissions of 755 for directories and 644 for files.

For a detailed description of unix permissions, see here.

Warren
Thank you for the explanation!
Masi
Is there any way to change recursively the permissions of directories to 755 and files to 644 by chmod? I noted that you can change all them -R option. However, that changes also directories if I am trying to apply it only to files.
Masi
@Masi: Assuming that . is the directory in which you want to change permissions for all subfolders and files: chmod 755 `find . -type d` chmod 644 `find . -type f`
bryan
Looks like the line breaks got stripped out of my comment above. Try: chmod 755 `find . -type d`; chmod 644 `find . -type f`
bryan
@bryan: Thank you for your answers!
Masi