def get_cache_dir(obj, filepath, cache_filename):
today = datetime.now().date()
custom_dir_name = "%s-%s-%s" % (today.year, today.month, today.day)
return os.path.join('cache', filepath, custom_dir_name, cache_filename)
class Photo(ImageModel):
class IKOptions:
spec_module = "photos.imagespecs"
cache_dir = get_cache_dir
cache_filename_format = "%(specname)s/%(filename)s.%(extension)s"
storage = DefaultStorage()
Ref:
http://stackoverflow.com/questions/8878119/django-imagekit-and-dynamic-paths
http://groups.google.com/group/django-photologue/browse_thread/thread/dada26db64844398
https://bitbucket.org/jdriscoll/django-imagekit/wiki/Options