  
  OBJECT_STORE_DIR = os.path.join(settings.MEDIA_ROOT, 'objectstore')
  
  
  class ObjectStoreRoot(Resource):
      """Root of the Object Store API.
      Allows the client to get a complete list of all the stored objects, or to create a new stored object."""
      allowed_methods = anon_allowed_methods = ('GET', 'POST')
 
</s> remove     """Remove the oldest files in a directory 'dir', leaving at most 'max_files' remaining"""
 </s> add     """Remove the oldest files in a directory 'dir', leaving at most 'max_files' remaining.
    We use this to limit the number of resources in the sandbox.""" </s> remove MAX_FILES = 5
 </s> add MAX_FILES = 20
MAX_FILES = 20


def remove_oldest_files(dir, max_files):
    """Remove the oldest files in a directory 'dir', leaving at most 'max_files' remaining.
    We use this to limit the number of resources in the sandbox."""
    filepaths = [os.path.join(dir, file) for file in os.listdir(dir)]
    ctime_sorted_paths = [item[0] for item in sorted([(path, os.path.getctime(path)) for path in filepaths],
                                                     key=operator.itemgetter(1), reverse=True)]
    [os.remove(path) for path in ctime_sorted_paths[max_files:]]
  
  OBJECT_STORE_DIR = os.path.join(settings.MEDIA_ROOT, 'objectstore')
MAX_FILES = 20


def remove_oldest_files(dir, max_files):
    """Remove the oldest files in a directory 'dir', leaving at most 'max_files' remaining.
    We use this to limit the number of resources in the sandbox."""
    filepaths = [os.path.join(dir, file) for file in os.listdir(dir)]
    ctime_sorted_paths = [item[0] for item in sorted([(path, os.path.getctime(path)) for path in filepaths],
                                                     key=operator.itemgetter(1), reverse=True)]
    [os.remove(path) for path in ctime_sorted_paths[max_files:]]
  
  
  class ObjectStoreRoot(Resource):
      """Root of the Object Store API.
      Allows the client to get a complete list of all the stored objects, or to create a new stored object."""
      allowed_methods = anon_allowed_methods = ('GET', 'POST')
keep add keep keep keep keep keep keep
 Minor changes to examples and docs 
examples/objectstore/views.py