Change Image name when model field updates {DJANGO} April 26, 2021 if instance.id: new_name = '{}.{}'.format(instance.pk, ext) print(f'name is {new_name}') return os.path.join('images', new_name) Read more