When a user logs into the database, he generates a WAV audio file (in the browser) which has to be stored in the database. The problem is that, everything is fine when I store the file for the first time. But, when I store after that, I get IntegrityError
. Does anyone have the solution to this?
My current models.py
is the following:
class InputFile(models.Model):
audio_file = models.FileField(upload_to='audio_files')
input_user = models.ForeignKey(User)
rec_date = models.DateTimeField('date recorded', auto_now_add=True)