]> git.0d.be Git - wcs-on-openshift.git/commitdiff
serve some static files using WhiteNoise master
authorFrédéric Péters <fpeters@0d.be>
Thu, 13 Aug 2015 08:51:00 +0000 (10:51 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 13 Aug 2015 08:55:04 +0000 (10:55 +0200)
requirements.txt
wsgi.py

index cf3264b99dd87ba476b5d4bc8be14e7e619f81ea..4e7e0ae12c0aa779bb7588dce4a7c5413077cee1 100644 (file)
@@ -1 +1,2 @@
 quixote
+whitenoise
diff --git a/wsgi.py b/wsgi.py
index 52e52295b5d28c2726a053653cce1f2ffe10f7c0..9dc3bae672d73f56358fbb084bc22e14d1321592 100644 (file)
--- a/wsgi.py
+++ b/wsgi.py
@@ -14,6 +14,8 @@ if 'OPENSHIFT_PYTHON_DIR' in os.environ:
 # line, it's possible required libraries won't be in your searchable path
 #
 
+from whitenoise import WhiteNoise
+
 BASE_WCS_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'wcs')
 sys.path.append(BASE_WCS_DIR)
 if os.path.exists(os.path.join(BASE_WCS_DIR, 'data/vendor/effective_tld_names.dat')):
@@ -49,8 +51,8 @@ publisher.WcsPublisher.APP_DIR = os.environ.get('OPENSHIFT_DATA_DIR', '/tmp/')
 publisher.WcsPublisher.DATA_DIR = os.path.join(BASE_WCS_DIR, 'data')
 pub = publisher.WcsPublisher.create_publisher(register_cron=False)
 
-application = QWIP(pub)
-
+application = WhiteNoise(QWIP(pub))
+application.add_files(os.path.join(BASE_WCS_DIR, 'wcs/qommon/static'), 'qo')
 
 if __name__ == '__main__':
     from wsgiref.simple_server import make_server