Skip to content

Instantly share code, notes, and snippets.

@bobycloud
Created December 2, 2019 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobycloud/eab9f413b4eb0841ae15ad3cd940ca0e to your computer and use it in GitHub Desktop.
Save bobycloud/eab9f413b4eb0841ae15ad3cd940ca0e to your computer and use it in GitHub Desktop.
Django Filer
path: /venv/lib64/python3.7/site-packages/filer/utils/generate_filename.y
def randomized(instance, filename):
import uuid
uuid_str = str(uuid.uuid4())
return os.path.join(uuid_str[0:2], uuid_str[2:4], uuid_str,
get_valid_filename(filename))
def randomized(instance, filename):
return filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment