1. paulswartz
  2. django-storages


Ryan Kaskel  committed e971e8f

Respect HashPathStorage.location.

  • Participants
  • Parent commits a59c9ea
  • Branches default

Comments (0)

Files changed (1)

File storages/backends/hashpath.py

View file
 import os, hashlib, errno
-from django.conf import settings
 from django.core.files.storage import FileSystemStorage
 from django.utils.encoding import force_unicode
         if self.exists(name):
             return name
-        # Try to create the directory relative to the media root
+        # Try to create the directory relative to location specified in __init__
-            os.makedirs(os.path.join(settings.MEDIA_ROOT, dir_name))
+            os.makedirs(os.path.join(self.location, dir_name))
         except OSError, e:
             if e.errno is not errno.EEXIST:
                 raise e