I was having trouble with the permissions of directories created by
Django during file uploads. One solution would be a setting like
FILE_UPLOAD_PERMISSIONS that would be used when directories are
created. This is what is currently done in FileSystemStorage:
def _save(self, name, content):
full_path = self.path(name)
directory = os.path.dirname(full_path)
if not os.path.exists(directory):
os.makedirs(directory)
Controlling directory perms would seem to be consistent with the
ability to control file permissions that's already there. Hmm... but
looking at ticket #8454 it seems that the file setting was added
because the umask wasn't be respected sometimes, and it should always
be with makedirs, right?
My upload dir does have a sgid bit but I am using the Django models
outside of the web app in scripts run by different users, so that is
one part of my problem that may be particular to me.
Maybe I should just be ensuring that I'm always setting a proper umask
in my scripts and with Apache (or does Django set it using the wsgi
handler?). If a separate setting is in order I can submit a patch
though.
Thanks,
Jason
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---