This will get all files in a directory and remove them.
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
dir = os.path.join(BASE_DIR, "foldername")
for root, dirs, files in os.walk(dir):
for file in files:
path = os.path.join(dir, file)
os.remove(path)