Created
December 28, 2010 12:08
-
-
Save jezdez/757166 to your computer and use it in GitHub Desktop.
support for legacy locations of app media (in APP/media/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your settings.py | |
STATICFILES_FINDERS += ( | |
'mysite.finders.AppMediaFinder' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################################## | |
# | |
# OMFG -- DON'T SHIP THIS WITH YOUR REUSABLE APP, SINCE IT WON'T BE REUSABLE ANYMORE. | |
# | |
########################################################################################## | |
from django.contrib.staticfiles.finders import AppDirectoriesFinder | |
from django.contrib.staticfiles.storage import AppStaticStorage | |
class LegacyAppStaticStorage(AppStaticStorage): | |
source_dir = 'media' | |
class AppMediaFinder(AppDirectoriesFinder): | |
storage_class = LegacyAppStaticStorage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment