Skip to content

Commit e97a883

Browse files
committedFeb 26, 2015
Serve static files with whitenoise
1 parent 000c360 commit e97a883

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed
 

‎minicomi/settings/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@
8282
# https://docs.djangoproject.com/en/1.7/howto/static-files/
8383

8484
STATIC_URL = '/static/'
85+
STATIC_ROOT = 'static'

‎minicomi/settings/production.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44

55

66
DATABASES['default'] = dj_database_url.config()
7+
8+
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'

‎minicomi/wsgi.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
import os
1010

1111
from django.core.wsgi import get_wsgi_application
12+
from whitenoise.django import DjangoWhiteNoise
1213

1314

1415
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "minicomi.settings.base")
1516

16-
application = get_wsgi_application()
17+
application = DjangoWhiteNoise(get_wsgi_application())

‎requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ aiohttp==0.14.4
33
dj-database-url==0.3.0
44
gunicorn==19.2.1
55
psycopg2==2.5.4
6+
whitenoise==1.0.6

‎static/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

0 commit comments

Comments
 (0)
Please sign in to comment.