I have a ImageField that stores in AWS S3 (similar to FileField). In the form, it has this \"Currently\" label that shows the image file path. I would like to trim and just show
In Django 1.11.x get_template_substitution_values
is deprecated. New implementation of CustomClearableFileInput
could be as follow:
class CustomClearableFileInput(ClearableFileInput):
def get_context(self, name, value, attrs):
value.name = path.basename(value.name)
context = super().get_context(name, value, attrs)
return context