[Answered ]-Django FileField in model maximum recursion depth exceeded while calling a Python object

2👍

Calling the save method on a FileField will trigger it’s model’s save method by default. You can bypass it by providing an additional third argument to the FileField‘s save method.

self.subtitles.save(filenameToSave, ContentFile("WEBVTT\n\n" + m), False)

Have a look at:

https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.fields.files.FieldFile.save

Leave a comment