Skip to content

Instantly share code, notes, and snippets.

View slavnycoder's full-sized avatar
🐘
💨

slavnycoder

🐘
💨
View GitHub Profile
@slavnycoder
slavnycoder / django-storage-walk.py
Last active May 19, 2020 12:35 — forked from btimby/django-storage-walk.py
os.walk() clone that uses Django storage object
import os
def storage_walk(storage, top='/'):
"""
List all files in django storage
"""
dirs, nondirs = storage.listdir(top)
for name in nondirs:
yield os.path.join(top, name)