]> git.parisson.com Git - telemeta.git/commitdiff
automatically setup cache values against MEDIA_ROOT (closes #95)
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Sun, 31 Jan 2016 08:31:00 +0000 (09:31 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Sun, 31 Jan 2016 08:31:00 +0000 (09:31 +0100)
telemeta/pages
telemeta/views/core.py

index 4fcb6022f8a1cf0780fc526737e84b8e690c1f88..f8324093174d077b674ac2c52eb0db6eaf815ab5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4fcb6022f8a1cf0780fc526737e84b8e690c1f88
+Subproject commit f8324093174d077b674ac2c52eb0db6eaf815ab5
index 0ea75b39b0a3fce12bf9b65be7234ab1aaaa419d..42e2fe5ff46e5b7955447c412ca62de755e392d4 100644 (file)
@@ -98,9 +98,11 @@ mods = {'item': MediaItem, 'collection': MediaCollection,
 
 class TelemetaBaseMixin(object):
 
-    cache_data = TelemetaCache(settings.TELEMETA_DATA_CACHE_DIR)
-    cache_export = TelemetaCache(settings.TELEMETA_EXPORT_CACHE_DIR)
-    cache_tmp = TelemetaCache(settings.FILE_UPLOAD_TEMP_DIR)
+    MEDIA_ROOT = getattr(settings, 'MEDIA_ROOT')
+    CACHE_DIR = os.path.join(MEDIA_ROOT, 'cache')
+    cache_data = TelemetaCache(getattr(settings, 'TELEMETA_DATA_CACHE_DIR', CACHE_DIR))
+    cache_export = TelemetaCache(getattr(settings, 'TELEMETA_EXPORT_CACHE_DIR', os.path.join(CACHE_DIR, 'export')))
+    cache_tmp = TelemetaCache(getattr(settings, 'FILE_UPLOAD_TEMP_DIR', os.path.join(MEDIA_ROOT, 'tmp')))
 
 
 class FixedFileWrapper(FileWrapper):