From 83770a80a987ae73c911f2f5cc1927358c51b9d9 Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Tue, 1 Nov 2016 13:57:12 -0400 Subject: [PATCH] Prepping for Heroku. --- settings.py | 2 +- wsgi.py | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/settings.py b/settings.py index 0fd6d09..e7c6085 100644 --- a/settings.py +++ b/settings.py @@ -74,7 +74,7 @@ SITE_ID = 1 STATICFILES_DIRS = (os.path.join(BASE_PATH, 'media'),) STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder') -STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' +STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' STATIC_ROOT = os.path.join(BASE_PATH, 'static') STATIC_URL = '/static/' TASTYPIE_CANNED_ERROR = """There was an error with your request. The site diff --git a/wsgi.py b/wsgi.py index fd45078..f945f5a 100644 --- a/wsgi.py +++ b/wsgi.py @@ -1,16 +1,5 @@ -""" -WSGI config for what project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ -""" - -import os -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") - from django.core.wsgi import get_wsgi_application -from dj_static import Cling +from whitenoise.django import DjangoWhiteNoise -application = Cling(get_wsgi_application()) +application = get_wsgi_application() +application = DjangoWhiteNoise(application)