Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Added COLLECTFAST_CACHE setting so backend cache can be configured by user #26

Merged
merged 1 commit into from
Mar 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ INSTALLED_APPS = (
)
```

Optionally, you can set `COLLECTFAST_CACHE` in your Django settings.py file to specify a specific cache backend for collectfast to use. By default it is set to the `default` cache.

Usage
-----

Expand Down
4 changes: 3 additions & 1 deletion collectfast/management/commands/collectstatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
from optparse import make_option
import datetime

from django.conf import settings
from django.contrib.staticfiles.management.commands import collectstatic
from django.core.cache import cache
from django.core.cache import get_cache
from django.core.files.storage import FileSystemStorage
from django.core.management.base import CommandError
from django.utils.encoding import smart_str

cache = get_cache(getattr(settings, "COLLECTFAST_CACHE", "default"))

class Command(collectstatic.Command):
option_list = collectstatic.Command.option_list + (
Expand Down