#21219: The FILE_UPLOAD_PERMISSIONS should not be used when deploying static 
files
-------------------------------------+------------------------------------
     Reporter:  dblack+django@…      |                    Owner:  vajrasky
         Type:  New feature          |                   Status:  assigned
    Component:  contrib.staticfiles  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+------------------------------------
Changes (by vajrasky):

 * status:  new => assigned
 * owner:  nobody => vajrasky


Comment:

 Let me get this straight.

 So FileSystemStorage has self.file_permissions_mode and
 self.directory_permissions_mode. Their values come from
 settings.FILE_UPLOAD_PERMISSIONS and
 settings.FILE_UPLOAD_DIRECTORY_PERMISSIONS.

 For StaticFilesStorage, the situation is same. But if you dislike the
 permissions, all you have to do is...


 {{{
 class CustomStaticFilesStorage(StaticFilesStorage):
   def __init__(self, location=None, base_url=None, *args, **kwargs):
     self.file_permissions_mode = 0o644
     self.directory_permissions_mode = 0o600
     super(CustomStaticFilesStorage, self).__init__(location, base_url,
                                                  *args, **kwargs)

 settings.STATICFILES_STORAGE = CustomStaticFilesStorage()
 }}}


 Is that what is in your mind?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21219#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/085.53312aa8f270e3d4206c45f592413d8d%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to