Skip to content

Commit

Permalink
Custom Storage with file and directory permissions.
Browse files Browse the repository at this point in the history
  • Loading branch information
glogiotatidis committed Jun 27, 2016
1 parent a230fee commit 6ae4ae2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion kitsune/settings.py
Expand Up @@ -372,7 +372,8 @@ def path(*parts):
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'

STATICFILES_STORAGE = 'kitsune.sumo.storage.SumoFilesStorage'

# Paths that don't require a locale prefix.
SUPPORTED_NONLOCALES = (
Expand Down
8 changes: 8 additions & 0 deletions kitsune/sumo/storage.py
@@ -0,0 +1,8 @@
from pipeline.storage import PipelineCachedStorage


class SumoFilesStorage(PipelineCachedStorage):
def __init__(self, *args, **kwargs):
kwargs['file_permissions_mode'] = 0o644
kwargs['directory_permissions_mode'] = 0o755
super(SumoFilesStorage, self).__init__(*args, **kwargs)
4 changes: 2 additions & 2 deletions requirements/default.txt
Expand Up @@ -119,8 +119,8 @@ django-nose==1.4.3
# sha256: jTddtwi8h_bfm7OulO3QG-0su2polKkneF3tmu3pg-8
https://github.com/gintas/django-picklefield/archive/54b11bdb177fd6140c3ae7d6e9744eaa2deda261.tar.gz#egg=django-picklefield

# sha256: qHdlkXjQIGzCbUPl35f4CZkbGPU5-VvsWnFkHaDXDkE
django-pipeline==1.6.5
# sha256: gTftCmQ1YK4jAOESeOBJB_ChIIAxoAaUdHccq2gA8yU
https://github.com/glogiotatidis/django-pipeline/archive/103bb549cd5f93b5648e10f1be6c2c6c8c5e9610.tar.gz#egg=django-pipeline

# django-ratelimit: tags/v0.4.0~8
# sha256: 0aNL6oRLRBHhGYsH0mm3D7UQDaSnNbdsHJl_sPuUZGw
Expand Down

0 comments on commit 6ae4ae2

Please sign in to comment.