Cleaned up bower_storage a bit.

- Legacy-Id: 9952
This commit is contained in:
Henrik Levkowetz 2015-08-01 15:03:40 +00:00
parent ec84efedcd
commit 7a059c908a

View file

@ -2,8 +2,11 @@ from django.core.files.storage import FileSystemStorage
from django.contrib.staticfiles.finders import BaseStorageFinder
from django.conf import settings
if settings.SERVER_MODE != 'production':
# We need this during test and development in order to find the external
# static files which are managed with bower (using manage.py bower_install)
class BowerStorageFinder(BaseStorageFinder):
storage = FileSystemStorage(location=settings.STATIC_ROOT, base_url=settings.STATIC_URL)
import debug # pyflakes:ignore
class BowerStorageFinder(BaseStorageFinder):
storage = FileSystemStorage(location=settings.COMPONENT_ROOT, base_url=settings.COMPONENT_URL)
def find(self, path, all=False):
files = super(BowerStorageFinder, self).find(path, all)
return files