BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/304754

Change subject: Allow configuration of static_root
......................................................................

Allow configuration of static_root

Add ini setting to change the path of the collected static files
directory. This can be used in a production environment to place the
collected static files in a location that makes more sense for serving
with a traditional web server like apache or nginx. The Django runtime
still needs to have access to this directory as it contains the manifest
file providing filenames for the long cache duration files.

Change-Id: I416a501d2950cbdc295b586468cecec1540f6f59
---
M striker/settings.py
M striker/striker.ini
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/54/304754/1

diff --git a/striker/settings.py b/striker/settings.py
index 902839f..3e22c2e 100644
--- a/striker/settings.py
+++ b/striker/settings.py
@@ -186,7 +186,9 @@
 USE_TZ = True
 
 STATIC_URL = '/static/'
-STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
+STATIC_ROOT = ini.get('static', 'STATIC_ROOT')
+if STATIC_ROOT == 'default':
+    STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
 STATICFILES_DIRS = (
     os.path.join(BASE_DIR, 'static'),
 )
diff --git a/striker/striker.ini b/striker/striker.ini
index 5ef944c..7b87998 100644
--- a/striker/striker.ini
+++ b/striker/striker.ini
@@ -96,3 +96,6 @@
 # (e.g. nginx, varnish) is between the application and the client to block
 # Host: header manipulation attacks.
 ALLOWED_HOSTS = *
+
+[static]
+STATIC_ROOT = default

-- 
To view, visit https://gerrit.wikimedia.org/r/304754
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I416a501d2950cbdc295b586468cecec1540f6f59
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to