-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
custom django storage, so boto push happens on collectstatic
- Loading branch information
Josh Levinger
committed
May 6, 2013
1 parent
9a290f4
commit 37b458d
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from django.conf import settings | ||
from django.contrib.staticfiles.storage import CachedFilesMixin | ||
from storages.backends.s3boto import S3BotoStorage | ||
|
||
class CachedStaticS3BotoStorage(CachedFilesMixin, S3BotoStorage): | ||
pass | ||
|
||
class StaticRootS3BotoStorage(CachedStaticS3BotoStorage): | ||
""" | ||
Storage for static files. | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
kwargs['location'] = 'static' | ||
super(CachedStaticS3BotoStorage, self).__init__(*args, **kwargs) | ||
|
||
class MediaRootS3BotoStorage(CachedStaticS3BotoStorage): | ||
""" | ||
Storage for uploaded media files. | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
kwargs['location'] = 'media' | ||
super(CachedStaticS3BotoStorage, self).__init__(*args, **kwargs) |